Skip to content

Commit

Permalink
fix: gacm use switch cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
alqmc authored and kinfuy committed Oct 20, 2022
1 parent 607301a commit 54c3d2a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
9 changes: 5 additions & 4 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,11 @@ const useUse = async ([name], cmd) => {
};
})
});
if (useUser)
useUser = user;
else
return log.error(`user cancels operation`);
if (!user) {
log.error(`user cancels operation`);
return;
}
useUser = user;
}
if (!useUser)
return log.error(`${name} not found`);
Expand Down
50 changes: 25 additions & 25 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "gacm",
"version": "1.1.3",
"private": false,
"description": "git account manage",
"keywords": [
"git",
"account",
"manage"
],
"license": "MIT",
"author": "alqmc",
"bin": {
"gacm": "main.js"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"commander": "^9.3.0",
"execa": "5.1.1",
"kolorist": "^1.5.1",
"prompts": "^2.4.2"
}
}
{
"name": "gacm",
"version": "1.1.3",
"private": false,
"description": "git account manage",
"keywords": [
"git",
"account",
"manage"
],
"license": "MIT",
"author": "alqmc",
"bin": {
"gacm": "main.js"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"commander": "^9.3.0",
"execa": "5.1.1",
"kolorist": "^1.5.1",
"prompts": "^2.4.2"
}
}
8 changes: 5 additions & 3 deletions package/commands/useUse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export const useUse = async ([name]: string[], cmd: UseCmd) => {
};
}),
});

if (useUser) useUser = user;
else return log.error(`user cancels operation`);
if (!user) {
log.error(`user cancels operation`);
return;
}
useUser = user;
}

if (!useUser) return log.error(`${name} not found`);
Expand Down

0 comments on commit 54c3d2a

Please sign in to comment.