Skip to content

Commit dcefced

Browse files
authored
Merge pull request #118 from paynechu/master
Make CLI executes in process.env.SHELL
2 parents 138eae6 + 03b5f79 commit dcefced

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/project/nativeScriptCli.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class NativeScriptCli {
5656
versionStr = this.executeSync(["--version"], undefined);
5757
}
5858
catch(e) {
59+
this._logger.log(e, Tags.FrontendMessage);
5960
throw new Error("NativeScript CLI not found. Use 'nativescript.tnsPath' workspace setting to explicitly set the absolute path to the NativeScript CLI.");
6061
}
6162
let cliVersion: Version = versionStr ? Version.parse(versionStr) : null;
@@ -74,14 +75,14 @@ export class NativeScriptCli {
7475
public executeSync(args: string[], cwd: string): string {
7576
let command: string = `${this._path} ` + args.join(' ');
7677
this._logger.log(`[NativeScriptCli] execute: ${command}`, Tags.FrontendMessage);
77-
return execSync(command, { encoding: "utf8", cwd: cwd }).toString().trim();
78+
return execSync(command, { encoding: "utf8", cwd: cwd, shell: process.env.SHELL }).toString().trim();
7879
}
7980

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

84-
let options = { cwd: cwd, shell: true };
85+
let options = { cwd: cwd, shell: process.env.SHELL };
8586
let child: ChildProcess = spawn(this._path, args, options);
8687
child.stdout.setEncoding('utf8');
8788
child.stderr.setEncoding('utf8');

0 commit comments

Comments
 (0)