Skip to content

Commit ee1a6a6

Browse files
authored
Escape all arguments passed to the xcrun simctl
Escape all arguments passed to the xcrun simctl
1 parent 80f6cb7 commit ee1a6a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/simctl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ export class Simctl implements ISimctl {
117117
}
118118

119119
private simctlExec(command: string, args: string[], opts?: any): any {
120-
let fullCommand = (["xcrun", "simctl", command].concat(args)).join(" ");
120+
let escapedArgs = args.map((arg) => `"${arg}"`);
121+
let fullCommand = (["xcrun", "simctl", command].concat(escapedArgs)).join(" ");
122+
121123
return childProcess.execSync(fullCommand, opts).toString().trim();
122124
}
123125
}

0 commit comments

Comments
 (0)