@@ -46,7 +46,8 @@ const setOptions = (program, definitions, terms) => {
4646
4747const createProgram = ( program , definitions , terms ) => {
4848 return setOptions ( program , definitions , terms )
49- . option ( `-d, --dry-run` , 'run dry-run mode' , false )
49+ . option ( `-d, --duet` , 'run git-duet mode' , false )
50+ . option ( `-D, --dry-run` , 'run dry-run mode' , false )
5051 . option ( `-i, --interactive` , 'run interactive mode' , false )
5152 . option ( `-s, --skip-options` , 'skip not required term input (interactive mode only)' , false )
5253 . version ( version )
@@ -147,19 +148,21 @@ const replaceTerm = (program, template, definition, term) => {
147148 return _ . replace ( template , `<${ term } >` , decoratedValue )
148149}
149150
150- const gitCommit = ( commitMessage , dryRun = false ) => {
151+ const gitCommit = ( commitMessage , duet = false , dryRun = false ) => {
151152 if ( dryRun ) {
152153 console . log ( "-------------------------" )
153154 console . log ( commitMessage )
154155 console . log ( "-------------------------" )
156+ } else if ( duet ) {
157+ execSync ( `git duet-commit -m "${ commitMessage } "` )
155158 } else {
156159 execSync ( `git commit -m "${ commitMessage } "` )
157160 }
158161}
159162
160163const main = ( program , template , definitions , terms ) => {
161164 const commitMessage = replaceTerms ( program , template , definitions , terms )
162- gitCommit ( commitMessage . trim ( ) , program . dryRun )
165+ gitCommit ( commitMessage . trim ( ) , program . duet , program . dryRun )
163166}
164167
165168//
0 commit comments