Skip to content

Commit db267c6

Browse files
yashk2000agg-shambhavi
authored andcommitted
🔧 cli: Store the generated branch name and commit message
1 parent d57063e commit db267c6

File tree

6 files changed

+320
-250
lines changed

6 files changed

+320
-250
lines changed

.gitgo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
},
77
"commit_guidelines": [
88
"fix:",
9-
" feat:",
10-
" chore:"
9+
"feat:",
10+
"chore:"
1111
],
1212
"custom_guidelines": false,
13-
"selected_commit_type": "",
13+
"selected_commit_type": "✨ Adding a new user-facing feature",
1414
"emojis": {
1515
"initial_commit": "tada",
1616
"feature": "sparkles",

bin/index.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const figlet = require('figlet');
55
const cowsay = require('cowsay');
66
const files = require('../lib/files.js');
77
const program = require('commander');
8-
const { getQuestions, getConfigQuestions } = require('../lib/inquirer.js');
8+
const { getQuestions, getConfigQuestions, displaySuggestions } = require('../lib/inquirer.js');
99

1010
clear();
1111

@@ -55,4 +55,27 @@ program
5555
}
5656
});
5757

58+
program
59+
.command('display')
60+
.alias('d')
61+
.action(function () {
62+
// displays Gitg0 on start
63+
if (files.directoryExists('.git')) {
64+
console.log(figlet.textSync('Gitg0', {
65+
horizontalLayout: 'default',
66+
verticalLayout: 'default',
67+
}), '\n');
68+
// asks task based questions
69+
displaySuggestions();
70+
} else {
71+
// checks if the directory is a git based repo or not
72+
console.log(cowsay.say({
73+
text: 'Not a git repository!',
74+
T: 'U '
75+
}
76+
));
77+
process.exit();
78+
}
79+
});
80+
5881
program.parse(process.argv);

0 commit comments

Comments
 (0)