From 22dfbc85d98cbe6e9c4cc842b60a3a54f96b5afc Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 2 Nov 2017 10:38:43 +0200 Subject: [PATCH 1/3] fix: executeCommand --- lib/utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils.ts b/lib/utils.ts index d650f8f..0ab237d 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,12 +1,12 @@ import * as childProcess from "child_process"; import { readFileSync } from "fs"; -export function executeCommand(args, cwd?): string { - cwd = cwd || process.cwd(); - - const output = childProcess.spawnSync("", args.split(" "), { +export function executeCommand(args, cwd = process.cwd()): string { + const commands = args.split(" "); + const baseCommand = commands.shift(); + const output = childProcess.spawnSync(baseCommand, commands, { shell: true, - cwd: process.cwd(), + cwd: cwd, encoding: "UTF8" }); From b20f66c4cb66749ee0a1d70a00f3fc383efdf27a Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 2 Nov 2017 10:57:04 +0200 Subject: [PATCH 2/3] fix: import --- lib/ios-manager.ts | 2 +- lib/utils.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ios-manager.ts b/lib/ios-manager.ts index 5abfec8..cb31005 100644 --- a/lib/ios-manager.ts +++ b/lib/ios-manager.ts @@ -1,4 +1,4 @@ -import { spawn, spawnSync } from "child_process"; +import { spawn } from "child_process"; import { resolve } from "path"; import { existsSync, readFileSync } from "fs"; import { waitForOutput, executeCommand, tailFilelUntil } from "./utils"; diff --git a/lib/utils.d.ts b/lib/utils.d.ts index 35f4d26..cc5062e 100644 --- a/lib/utils.d.ts +++ b/lib/utils.d.ts @@ -1,4 +1,4 @@ -export declare function executeCommand(args: any, cwd?: any): string; +export declare function executeCommand(args: any, cwd?: string): string; export declare function waitForOutput(process: any, matcher: any, errorMatcher: any, timeout: any): Promise; export declare function isWin(): boolean; export declare function killProcessByName(name: any): void; From b509ca3b23c6f399215b89ae97b5b2efb321d244 Mon Sep 17 00:00:00 2001 From: SvetoslavTsenov Date: Thu, 2 Nov 2017 16:23:18 +0200 Subject: [PATCH 3/3] chore: bump version 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f66871..a07b97a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobile-devices-controller", - "version": "0.0.5", + "version": "1.0.0", "description": "Manage simulators, emulators and devices", "main": "index.js", "scripts": {