Skip to content

Commit 06b1ea8

Browse files
author
ando
authored
Merge pull request #54 from iamando/develop
feature: check if file is modified or untracked
2 parents d8c69c6 + 4ed3633 commit 06b1ea8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/utils/commiter.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ export const commiter = async () => {
5353

5454
if (stderrStatus) throw new CliError(`An error occured: ${stderrStatus}`)
5555

56-
if (stdoutStatus.includes('no changes added to commit')) {
56+
if (
57+
stdoutStatus.includes('Changes not staged for commit') ||
58+
stdoutStatus.includes('Untracked files')
59+
) {
60+
const type = stdoutStatus.includes('Changes not staged for commit')
61+
? 'modified'
62+
: 'untracked'
5763
const addStagedFiles = await confirm({
58-
message:
59-
'No changes added to commit, would you like to add modified files ?',
64+
message: `No changes added to commit, would you like to add ${type} files ?`,
6065
initialValue: true,
6166
})
6267

0 commit comments

Comments
 (0)