Skip to content

Commit 93bb6fa

Browse files
committed
feat(main): show command
1 parent 2e35e18 commit 93bb6fa

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

git-consistent

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const reset = '\u001b[0m'
2424

2525
const messageColor = cyan
2626
const warningColor = yellow
27-
const errorColor = red
27+
const infoColor = magenta
28+
const errorColor = red
2829

2930
const version = '0.3.0'
3031

@@ -195,10 +196,15 @@ const gitCommit = (commitMessage, duet = false, dryRun = false) => {
195196
console.log("-------------------------")
196197
console.log(commitMessage)
197198
console.log("-------------------------")
198-
} else if (duet) {
199-
execSync(`git duet-commit -m "${commitMessage}"`)
200199
} else {
201-
execSync(`git commit -m "${commitMessage}"`)
200+
let command
201+
if (duet) {
202+
command = `git duet-commit -m "${commitMessage}"`
203+
} else {
204+
command = `git commit -m "${commitMessage}"`
205+
}
206+
console.log(`${infoColor}${command}${reset}`)
207+
execSync(command)
202208
}
203209
}
204210

0 commit comments

Comments
 (0)