fix(dev-infra): format command incorrectly prints outdated files (#42252)

When `ng-dev format --check` is run, the ng-dev tool prints out
all files that are out-of-date. We recently updated the format
tool to also capture `stderr` for failed files. This broke the
console message as we did not unwrap the `FormatFailure` to
their file path when printing the "ng-dev format" fix command.

PR Close #42252
This commit is contained in:
Paul Gschwendtner 2021-05-23 19:15:14 +02:00 committed by Zach Arend
parent ef33806480
commit c3cbfc22e0
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ export async function checkFiles(files: string[]) {
// Inform user how to format files in the future.
info();
info(`To format the failing file run the following command:`);
info(` yarn ng-dev format files ${failures.join(' ')}`);
info(` yarn ng-dev format files ${failures.map(f => f.filePath).join(' ')}`);
process.exit(1);
}
} else {

View File

@ -2683,7 +2683,7 @@ function checkFiles(files) {
// Inform user how to format files in the future.
info();
info(`To format the failing file run the following command:`);
info(` yarn ng-dev format files ${failures.join(' ')}`);
info(` yarn ng-dev format files ${failures.map(f => f.filePath).join(' ')}`);
process.exit(1);
}
}