Skip to content

Commit

Permalink
feat(ng-dev/format): add staged files back
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)
  • Loading branch information
dario-piotrowicz committed Feb 17, 2022
1 parent 0e1a218 commit a57cf8e
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 a57cf8e

Please sign in to comment.