feat(cli.ts, commit.ts): add --yes flag to skip commit confirmation prompt (#341)

docs(README.md): document the `--yes` flag usage in README for user guidance
This commit is contained in:
Ignacio Lago
2024-05-23 16:56:35 +09:00
committed by GitHub
parent f814c6b89d
commit 312540456a
3 changed files with 23 additions and 6 deletions
+8 -2
View File
@@ -18,7 +18,13 @@ cli(
name: 'opencommit',
commands: [configCommand, hookCommand, commitlintConfigCommand],
flags: {
fgm: Boolean
fgm: Boolean,
yes: {
type: Boolean,
alias: 'y',
description: 'Skip commit confirmation prompt',
default: false
}
},
ignoreArgv: (type) => type === 'unknown-flag' || type === 'argument',
help: { description: packageJSON.description }
@@ -29,7 +35,7 @@ cli(
if (await isHookCalled()) {
prepareCommitMessageHook();
} else {
commit(extraArgs, false, flags.fgm);
commit(extraArgs, false, flags.fgm, flags.yes);
}
},
extraArgs