Skip to content

Commit bfb0a13

Browse files
committed
refactor(@angular/cli): remove relative path conversion when adding files to format
Path are already relative.
1 parent 30bd75c commit bfb0a13

File tree

1 file changed

+4
-3
lines changed
  • packages/angular/cli/src/command-builder/utilities

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
*/
88

99
import { execFile } from 'node:child_process';
10+
import { existsSync } from 'node:fs';
1011
import { readFile } from 'node:fs/promises';
1112
import { createRequire } from 'node:module';
1213
import { platform } from 'node:os';
13-
import { dirname, extname, join, relative } from 'node:path';
14+
import { dirname, extname, join } from 'node:path';
1415
import { promisify } from 'node:util';
1516

1617
const execFileAsync = promisify(execFile);
@@ -61,8 +62,8 @@ export async function formatFiles(cwd: string, files: Set<string>): Promise<void
6162

6263
const filesToFormat: string[] = [];
6364
for (const file of files) {
64-
if (fileTypes.has(extname(file))) {
65-
filesToFormat.push(relative(cwd, file));
65+
if (fileTypes.has(extname(file)) && existsSync(join(cwd, file))) {
66+
filesToFormat.push(file);
6667
}
6768
}
6869

0 commit comments

Comments
 (0)