feat: pass down argv to git commit (#70)

This commit is contained in:
hiroki osame
2023-02-21 07:52:42 -05:00
committed by GitHub
parent 4a22c4029f
commit 65d753a1d6

View File

@@ -15,11 +15,18 @@ import {
generateCommitMessage,
} from './utils.js';
const rawArgv = process.argv.slice(2);
const argv = cli({
name: 'aicommits',
version,
/**
* Since this is a wrapper around `git commit`,
* flags should not overlap with it
* https://git-scm.com/docs/git-commit
*/
flags: {
generate: {
type: Number,
@@ -32,7 +39,9 @@ const argv = cli({
help: {
description,
},
});
ignoreArgv: type => type === 'unknown-flag' || type === 'argument',
}, undefined, rawArgv);
(async () => {
intro(bgCyan(black(' aicommits ')));
@@ -91,7 +100,7 @@ const argv = cli({
message = selected;
}
await execa('git', ['commit', '-m', message]);
await execa('git', ['commit', '-m', message, ...rawArgv]);
outro(`${green('✔')} Successfully committed!`);
})().catch((error) => {