Skip to content

Commit

Permalink
feat(ng-dev/format): add staged files back (#405)
Browse files Browse the repository at this point in the history
change the staged command so that after formatting it also adds
formatted files back to the staging area (unless --check is used
of course)

PR Close #405
  • Loading branch information
dario-piotrowicz authored and josephperrott committed Feb 17, 2022
1 parent 1e337f0 commit 74b89a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ng-dev/format/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export function buildFormatParser(localYargs: yargs.Argv) {
const executionCmd = check ? checkFiles : formatFiles;
const allStagedFiles = GitClient.get().allStagedFiles();
process.exitCode = await executionCmd(allStagedFiles);
if (!check && process.exitCode === 0) {
GitClient.get().runGraceful(['add', ...allStagedFiles]);
}
},
)
.command(
Expand Down

0 comments on commit 74b89a4

Please sign in to comment.