Skip to content

Commit

Permalink
Merge pull request #118 from paynechu/master
Browse files Browse the repository at this point in the history
Make CLI executes in process.env.SHELL
  • Loading branch information
ivanbuhov authored Mar 7, 2017
2 parents 138eae6 + 03b5f79 commit dcefced
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/project/nativeScriptCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class NativeScriptCli {
versionStr = this.executeSync(["--version"], undefined);
}
catch(e) {
this._logger.log(e, Tags.FrontendMessage);
throw new Error("NativeScript CLI not found. Use 'nativescript.tnsPath' workspace setting to explicitly set the absolute path to the NativeScript CLI.");
}
let cliVersion: Version = versionStr ? Version.parse(versionStr) : null;
Expand All @@ -74,14 +75,14 @@ export class NativeScriptCli {
public executeSync(args: string[], cwd: string): string {
let command: string = `${this._path} ` + args.join(' ');
this._logger.log(`[NativeScriptCli] execute: ${command}`, Tags.FrontendMessage);
return execSync(command, { encoding: "utf8", cwd: cwd }).toString().trim();
return execSync(command, { encoding: "utf8", cwd: cwd, shell: process.env.SHELL }).toString().trim();
}

public execute(args: string[], cwd: string): ChildProcess {
let command: string = `${this._path} ` + args.join(' ');
this._logger.log(`[NativeScriptCli] execute: ${command}`, Tags.FrontendMessage);

let options = { cwd: cwd, shell: true };
let options = { cwd: cwd, shell: process.env.SHELL };
let child: ChildProcess = spawn(this._path, args, options);
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
Expand Down

0 comments on commit dcefced

Please sign in to comment.