Skip to content

Commit e9f9ba6

Browse files
alqmcalqmc
authored andcommitted
fix: user not found
1 parent d77228e commit e9f9ba6

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

dist/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
1414
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
1515

1616
var name = "gacm";
17-
var version$1 = "0.0.3";
17+
var version$1 = "0.0.4";
1818
var description = "git account manage";
1919
var keywords = [
2020
"git",
@@ -150,6 +150,8 @@ const useAction = async (name, cmd) => {
150150
const userList = await getFileUser(registriesPath);
151151
if (!userList)
152152
return;
153+
if (!userList[name])
154+
return log.error(`${name} not found`);
153155
let env = 'local';
154156
if (cmd.system)
155157
env = 'system';

dist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gacm",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"private": false,
55
"description": "git account manage",
66
"keywords": [

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "gacm",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "gacm",
55
"scripts": {
66
"build": "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts",
77
"clear": "rimraf dist",
88
"link": "npm link",
9-
"push": "git push gitee master && git push github master",
9+
"push": "git push gitee dev && git push github dev",
1010
"update:version": "sucrase-node build/utils/version.ts",
1111
"log": "conventional-changelog -p custom-config -i CHANGELOG.md -s -n ./changelog-option.js"
1212
},

package/commands/useAction/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { AddCmd, UseCmd, UserInfoJson } from '../../type/shell.type';
1010
export const useAction = async (name: string, cmd: UseCmd) => {
1111
const userList = await getFileUser(registriesPath);
1212
if (!userList) return;
13+
if (!userList[name]) return log.error(`${name} not found`);
1314
let env = 'local';
1415
if (cmd.system) env = 'system';
1516
if (cmd.global) env = 'global';

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gacm",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"private": false,
55
"description": "git account manage",
66
"keywords": [

0 commit comments

Comments
 (0)