From 68a500b9ea6a18a9a3c78a8f70ca6c4830184f9e Mon Sep 17 00:00:00 2001 From: xzz Date: Fri, 18 Nov 2022 23:29:59 +0800 Subject: [PATCH] fix: gacm ls nouser error(#21) --- package/commands/gacm/useLs.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package/commands/gacm/useLs.ts b/package/commands/gacm/useLs.ts index bcad756..bd915ba 100644 --- a/package/commands/gacm/useLs.ts +++ b/package/commands/gacm/useLs.ts @@ -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');