Skip to content

Commit 39342af

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

File tree

1 file changed

+10
-6
lines changed
  • packages/angular/cli/src/command-builder/utilities

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { execFile } from 'node:child_process';
1010
import { readFile } from 'node:fs/promises';
1111
import { createRequire } from 'node:module';
1212
import { platform } from 'node:os';
13-
import { dirname, extname, join, relative } from 'node:path';
13+
import { dirname, extname, join } from 'node:path';
1414
import { promisify } from 'node:util';
1515

1616
const execFileAsync = promisify(execFile);
@@ -62,16 +62,20 @@ export async function formatFiles(cwd: string, files: Set<string>): Promise<void
6262
const filesToFormat: string[] = [];
6363
for (const file of files) {
6464
if (fileTypes.has(extname(file))) {
65-
filesToFormat.push(relative(cwd, file));
65+
filesToFormat.push(file);
6666
}
6767
}
6868

6969
if (!filesToFormat.length) {
7070
return;
7171
}
7272

73-
await execFileAsync(prettierCliPath, ['--write', ...filesToFormat], {
74-
cwd,
75-
shell: platform() === 'win32',
76-
});
73+
await execFileAsync(
74+
prettierCliPath,
75+
['--write', '--no-error-on-unmatched-pattern', ...filesToFormat],
76+
{
77+
cwd,
78+
shell: platform() === 'win32',
79+
},
80+
);
7781
}

0 commit comments

Comments
 (0)