Skip to content

Commit

Permalink
fix: verison shell
Browse files Browse the repository at this point in the history
  • Loading branch information
alqmc authored and alqmc committed Jul 7, 2022
1 parent 251ab4b commit 1b9003b
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 39 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

### Features

-git账户无痛切换
-git账户无缝切换

- ⚡️ 简便的cli 工具

- 🚀 极简的操作方式
- 🚀 极简的操作方式,just like nvm

- 😊 gacm ls 自动添加本地git账户

Expand All @@ -50,11 +48,6 @@ gacm add --name xxx --email xxx
gacm delate user

```

### Care

- 💀 更新会丢失用户

### License

MIT License © 2022 [阿乐去买菜(alqmc)](https://github.com/alqmc)
Expand Down
4 changes: 2 additions & 2 deletions build/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export default series(
withTask('update:version', () => run('pnpm run update:version')),
withTask('clear', () => run('pnpm run clear')),
buildBundle,
copyFiles
// withTask('clear', () => run('pnpm run link'))
copyFiles,
withTask('link', () => run('pnpm run link'))
);
7 changes: 7 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

- 🚀 极简的操作方式

- 😊 gacm ls 自动添加本地git账户



### Getting Started

Expand All @@ -48,6 +51,10 @@ gacm delate user

```

### Care

- 💀 更新会丢失用户

### License

MIT License © 2022 [阿乐去买菜(alqmc)](https://github.com/alqmc)
Expand Down
22 changes: 10 additions & 12 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

var commander = require('commander');
var chalk = require('kolorist');
var kolorist = require('kolorist');
var path = require('path');
var fs = require('fs');
var child_process = require('child_process');
Expand All @@ -11,11 +11,10 @@ var execa = require('execa');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);

var name = "gacm";
var version$1 = "0.0.8";
var version$1 = "0.0.7";
var description = "git account manage";
var keywords = [
"git",
Expand All @@ -31,7 +30,7 @@ var publishConfig = {
access: "public"
};
var dependencies = {
commander: "^2.4.2",
commander: "^9.3.0",
execa: "5.0.1",
kolorist: "^1.5.1",
minimist: "^1.2.6"
Expand All @@ -49,11 +48,10 @@ var pkg = {
dependencies: dependencies
};

const { green, red, lightYellow, blue } = chalk__default["default"];
const success = (msg) => console.log(green(msg));
const error = (msg) => console.log(red(msg));
const warning = (msg) => console.log(lightYellow(msg));
const info = (msg) => console.log(blue(msg));
const success = (msg) => console.log(kolorist.green(msg));
const error = (msg) => console.log(kolorist.red(msg));
const warning = (msg) => console.log(kolorist.lightYellow(msg));
const info = (msg) => console.log(kolorist.blue(msg));
const log = {
success,
error,
Expand Down Expand Up @@ -116,7 +114,7 @@ const execCommand = async (cmd, args) => {

const geneDashLine = (message, length) => {
const finalMessage = new Array(Math.max(2, length - message.length + 2)).join("-");
return padding(chalk.white(finalMessage));
return padding(kolorist.white(finalMessage));
};
const padding = (message = "", before = 1, after = 1) => {
return new Array(before).fill(" ").join(" ") + message + new Array(after).fill(" ").join(" ");
Expand Down Expand Up @@ -169,7 +167,7 @@ const lsAction = async () => {
const prefix = " ";
const messages = keys.map((key) => {
const registry = userList[key];
const currect = registry.name === currectUser ? `${chalk.green("*")}` : "";
const currect = registry.name === currectUser ? `${kolorist.green("*")}` : "";
return prefix + currect + registry.name + geneDashLine(key, length) + registry.email;
});
printMessages(messages);
Expand Down Expand Up @@ -202,7 +200,7 @@ const insertUser = async (name, email) => {
};

const program = new commander.Command();
program.option("-v, --version", "\u67E5\u770B\u5F53\u524D\u7248\u672C").usage("command <option>").description("template-node-cli").action(baseAction);
program.option("-v, --version", "\u67E5\u770B\u5F53\u524D\u7248\u672C").usage("command <option>").description("\u67E5\u770B\u5F53\u524D\u7248\u672C").action(baseAction);
program.command("ls").description("\u5F53\u524D\u7528\u6237\u5217\u8868").action(lsAction);
program.command("use <name>").option("-l, --local", "\u5F53\u524D\u7528\u6237").option("-g, --global", "\u5168\u5C40\u7528\u6237").option("-s, --system", "\u7CFB\u7EDF\u7528\u6237").description("\u5207\u6362\u7528\u6237").action(useAction);
program.command("add").option("-n, --name <name>", "\u5F53\u524D\u7528\u6237").option("-e, --email <email>", "\u5168\u5C40\u7528\u6237").description("\u6DFB\u52A0\u7528\u6237").action(addAction);
Expand Down
4 changes: 2 additions & 2 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gacm",
"version": "0.0.8",
"version": "0.0.7",
"private": false,
"description": "git account manage",
"keywords": [
Expand All @@ -17,7 +17,7 @@
"access": "public"
},
"dependencies": {
"commander": "^2.4.2",
"commander": "^9.3.0",
"execa": "5.0.1",
"kolorist": "^1.5.1",
"minimist": "^1.2.6"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "gacm",
"version": "0.0.8",
"version": "0.0.7",
"description": "gacm",
"scripts": {
"build": "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts",
"clear": "rimraf dist",
"link": "npm link",
"link": "pnpm link --global",
"push": "git push gitee master && git push github master",
"update:version": "sucrase-node build/utils/version.ts",
"log": "conventional-changelog -p custom-config -i CHANGELOG.md -s -n ./changelog-option.js",
Expand Down Expand Up @@ -51,7 +51,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"commander": "^2.4.2",
"commander": "^9.3.0",
"execa": "5.0.1",
"kolorist": "^1.5.1",
"minimist": "^1.2.6"
Expand Down
2 changes: 1 addition & 1 deletion package/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const program = new Command();
program
.option('-v, --version', '查看当前版本')
.usage('command <option>')
.description('template-node-cli')
.description('查看当前版本')
.action(baseAction);

program.command('ls').description('当前用户列表').action(lsAction);
Expand Down
4 changes: 2 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gacm",
"version": "0.0.8",
"version": "0.0.7",
"private": false,
"description": "git account manage",
"keywords": [
Expand All @@ -17,7 +17,7 @@
"access": "public"
},
"dependencies": {
"commander": "^2.4.2",
"commander": "^9.3.0",
"execa": "5.0.1",
"kolorist": "^1.5.1",
"minimist": "^1.2.6"
Expand Down
3 changes: 1 addition & 2 deletions package/utils/log.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import chalk from 'kolorist';
const { green, red, lightYellow, blue } = chalk;
import { blue, green, lightYellow, red } from 'kolorist';
const success = (msg: string) => console.log(green(msg));
const error = (msg: string) => console.log(red(msg));
const warning = (msg: string) => console.log(lightYellow(msg));
Expand Down
13 changes: 7 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b9003b

Please sign in to comment.