豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 74b89a4

Browse files
dario-piotrowiczjosephperrott
authored andcommitted
feat(ng-dev/format): add staged files back (#405)
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
1 parent 1e337f0 commit 74b89a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ng-dev/format/cli.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export function buildFormatParser(localYargs: yargs.Argv) {
5151
const executionCmd = check ? checkFiles : formatFiles;
5252
const allStagedFiles = GitClient.get().allStagedFiles();
5353
process.exitCode = await executionCmd(allStagedFiles);
54+
if (!check && process.exitCode === 0) {
55+
GitClient.get().runGraceful(['add', ...allStagedFiles]);
56+
}
5457
},
5558
)
5659
.command(

0 commit comments

Comments
 (0)