Skip to content

Commit 721dd1b

Browse files
committed
fix: list when empty user
1 parent e3a5196 commit 721dd1b

File tree

3 files changed

+1519
-4
lines changed

3 files changed

+1519
-4
lines changed

Diff for: cli.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if (process.argv.length === 2) {
5454
/* //////////////// cmd methods ///////////////// */
5555

5656
function onList() {
57-
getCurrentConfig((cur, cemail) => {
57+
getCurrentConfig((cur = '', cemail = '') => {
5858
const info = [''];
5959
const alluserList = getAllConfig();
6060
let isMatch = false;
@@ -75,7 +75,9 @@ function onList() {
7575

7676
if (alluserList && Object.keys(alluserList).length === 0) {
7777
debug('alluserList empty');
78-
if (!cur) return;
78+
if (!cur) {
79+
return;
80+
}
7981
autoInit();
8082
return printMsg([`* ${cur}${line(cur, 12)}${cemail}`]);
8183
}
@@ -181,7 +183,8 @@ function getCurrentConfig(cbk) {
181183
// });
182184
// }
183185
// });
184-
console.log('local user is empty, use gum to add user');
186+
console.log('local user is empty, use gum to add user in list:');
187+
cbk();
185188
} else {
186189
git.raw(['config', '--get', 'user.email'], (err, localemail) => {
187190
cbk(localuser.replace('\n', ''), localemail.replace('\n', ''));

0 commit comments

Comments
 (0)