Skip to content

Commit

Permalink
fix(windows): Properly escpae spaces in powershell with backticks (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku authored and jaysoo committed Nov 15, 2019
1 parent 105fb64 commit 919ca16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/vscode/src/app/ng-task/shell-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function getWin32ShellExecution(config: ShellConfig): ShellExecution {
shellArgs: [
`-Sta -NoLogo -NonInteractive -C "& {${config.program.replace(
/ /g,
'\\ '
'` ' // NOTE: In powershell ` is the escape key.
)} ${config.args.join(' ')}}"`
]
});
Expand Down
2 changes: 1 addition & 1 deletion apps/vscode/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function scanForWorkspace(vscodeWorkspacePath: string) {
currentDirectory = dirname(currentDirectory);
}

const childAngularJsonStream = stream(join('**', 'angular.json'), {
const childAngularJsonStream = stream('**/angular.json', {
cwd: vscodeWorkspacePath,
deep: 3,
onlyFiles: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,5 @@ export class TaskExecutionFormComponent implements OnInit, AfterViewChecked {

function sanitizeWhitespace(value: string) {
const trimmed = value.trim();
return /\s/.test(trimmed) ? `"${trimmed}"` : trimmed;
return /\s/.test(trimmed) ? `'${trimmed}'` : trimmed; // NOTE: We use ' rather than " for powershell compatibility
}

0 comments on commit 919ca16

Please sign in to comment.