Skip to content

Commit

Permalink
fix: gacm ls nouser error(#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
9listen committed Nov 18, 2022
1 parent 30f3dba commit 68a500b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package/commands/gacm/useLs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ export const useLs = async () => {
(await getFileUser(registriesPath)) ||
({ version: pkg.version, users: [], registry: [] } as UserInfoJson);

const currectUser = await execCommand('git', ['config', 'user.name']);
const currectUser = await execCommand('git', ['config', 'user.name']).catch(
() => {}
);

const currectEmail = await execCommand('git', ['config', 'user.email']);
const currectEmail = await execCommand('git', ['config', 'user.email']).catch(
() => {}
);

if (userList.users.length === 0 && (!currectUser || !currectEmail)) {
return log.info('no user');
Expand Down

0 comments on commit 68a500b

Please sign in to comment.