Skip to content

Commit c33356a

Browse files
fix: executeCommand (#56)
* fix: executeCommand * chore: fix typo
1 parent f1383e2 commit c33356a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

lib/device-controller.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { INsCapabilities } from "./ins-capabilities";
2-
import { IDevice } from "mobile-devices-controller";
2+
import { IDevice, Device } from "mobile-devices-controller";
33
export declare class DeviceController {
44
private static _emulators;
5-
static startDevice(args: INsCapabilities): Promise<any>;
5+
static startDevice(args: INsCapabilities): Promise<IDevice | Device>;
66
static stop(args: INsCapabilities): Promise<void>;
77
static kill(device: IDevice): Promise<void>;
88
private static getDefaultDevice(args);

lib/device-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class DeviceController {
5555
await DeviceManager.startDevice(device);
5656
console.log("Started device: ", device);
5757
} else {
58-
console.log("Device is alredy started", device);
58+
console.log("Device is already started", device);
5959
if (!args.reuseDevice) {
6060
DeviceController.kill(device);
6161
await DeviceManager.startDevice(device);

lib/utils.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export declare function logErr(line: any, verbose: any): void;
1515
export declare function shutdown(processToKill: childProcess.ChildProcess, verbose: any): void;
1616
export declare function killPid(pid: any, verbose: any): void;
1717
export declare function waitForOutput(process: any, matcher: any, errorMatcher: any, timeout: any, verbose: any): Promise<boolean>;
18-
export declare function executeCommand(args: any, cwd?: any): string;
18+
export declare function executeCommand(args: any, cwd?: string): string;
1919
export declare function isWin(): boolean;
2020
export declare function getStorage(args: INsCapabilities): string;
2121
export declare function getReportPath(args: INsCapabilities): string;

lib/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ export function waitForOutput(process, matcher, errorMatcher, timeout, verbose)
218218
});
219219
}
220220

221-
export function executeCommand(args, cwd?): string {
222-
cwd = cwd || process.cwd();
223-
224-
const output = childProcess.spawnSync("", args.split(" "), {
221+
export function executeCommand(args, cwd = process.cwd()): string {
222+
const commands = args.split(" ");
223+
const baseCommand = commands.shift();
224+
const output = childProcess.spawnSync(baseCommand, commands, {
225225
shell: true,
226226
cwd: cwd,
227227
encoding: "UTF8"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nativescript-dev-appium",
33
"version": "3.0.0",
44
"description": "A NativeScript plugin to help integrate and run Appium tests",
5-
"author": "Telerik",
5+
"author": "NativeScript",
66
"license": "MIT",
77
"main": "./index.js",
88
"directories": {
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"app-root-path": "^2.0.1",
3232
"portastic": "^1.0.1",
33-
"mobile-devices-controller": "~0.0.4",
33+
"mobile-devices-controller": "~1.0.0",
3434
"colors": "^1.1.2",
3535
"blink-diff": "^1.0.13",
3636
"glob": "*",

0 commit comments

Comments
 (0)