Skip to content

Commit 5b05f25

Browse files
committed
fix(@angular/cli): enable shell option for Prettier execution on Windows platforms
shell is needed on Windows.
1 parent fbae1b6 commit 5b05f25

File tree

1 file changed

+5
-1
lines changed
  • packages/angular/cli/src/command-builder/utilities

1 file changed

+5
-1
lines changed

packages/angular/cli/src/command-builder/utilities/prettier.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { execFile } from 'node:child_process';
1010
import { readFile } from 'node:fs/promises';
1111
import { createRequire } from 'node:module';
12+
import { platform } from 'node:os';
1213
import { dirname, extname, join, relative } from 'node:path';
1314
import { promisify } from 'node:util';
1415

@@ -69,5 +70,8 @@ export async function formatFiles(cwd: string, files: Set<string>): Promise<void
6970
return;
7071
}
7172

72-
await execFileAsync(prettierCliPath, ['--write', ...filesToFormat], { cwd });
73+
await execFileAsync(prettierCliPath, ['--write', ...filesToFormat], {
74+
cwd,
75+
shell: platform() === 'win32',
76+
});
7377
}

0 commit comments

Comments
 (0)