@done-coding/cli-utils 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +6 -6
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import b, { existsSync as h, mkdirSync as k, writeFileSync as g, readFileSync as
|
|
|
6
6
|
import l from "crypto";
|
|
7
7
|
import H from "prompts";
|
|
8
8
|
import E from "yargs";
|
|
9
|
-
import { hideBin as
|
|
9
|
+
import { hideBin as R } from "yargs/helpers";
|
|
10
10
|
import { execSync as y } from "node:child_process";
|
|
11
11
|
import v from "json5";
|
|
12
12
|
export * from "json5";
|
|
@@ -98,10 +98,10 @@ const x = (...e) => {
|
|
|
98
98
|
},
|
|
99
99
|
...t
|
|
100
100
|
});
|
|
101
|
-
},
|
|
101
|
+
}, F = (e, r) => {
|
|
102
102
|
e ? c.error(e) : c.error(r.message), r != null && r.stack && c.error(r.stack), process.exit(1);
|
|
103
103
|
}, T = () => {
|
|
104
|
-
const e =
|
|
104
|
+
const e = R(process.argv);
|
|
105
105
|
return E(e);
|
|
106
106
|
}, j = (e, {
|
|
107
107
|
usage: r,
|
|
@@ -116,7 +116,7 @@ const x = (...e) => {
|
|
|
116
116
|
const u = "help";
|
|
117
117
|
return s = s.help(u), t ? s = s.version(t).alias("h", u).alias("v", "version") : s = s.alias("h", u), n && (s = s.options(n)), i && (s = Object.entries(i).reduce((w, [D, O]) => w.positional(D, O), s)), a && (s = s.command(a)), s;
|
|
118
118
|
}, ee = async ({ handler: e, ...r }) => {
|
|
119
|
-
const t = await j(T(), r).fail(
|
|
119
|
+
const t = await j(T(), r).fail(F).argv;
|
|
120
120
|
return e ? e(t) : t;
|
|
121
121
|
}, re = (e) => {
|
|
122
122
|
const { command: r, describe: t, handler: o = () => {
|
|
@@ -178,7 +178,7 @@ const A = async () => {
|
|
|
178
178
|
/** 必须保留 */
|
|
179
179
|
rootDir: {
|
|
180
180
|
type: "string",
|
|
181
|
-
alias: "
|
|
181
|
+
alias: "R",
|
|
182
182
|
describe: "运行目录",
|
|
183
183
|
/** 必须设置默认值 */
|
|
184
184
|
default: e
|
|
@@ -192,7 +192,7 @@ const A = async () => {
|
|
|
192
192
|
/** 必须保留 */
|
|
193
193
|
configPath: {
|
|
194
194
|
type: "string",
|
|
195
|
-
alias: "
|
|
195
|
+
alias: "C",
|
|
196
196
|
describe: "配置文件相对路径",
|
|
197
197
|
/** 必须设置默认值 */
|
|
198
198
|
default: e
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "cli utils",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"prompts": "^2.4.2",
|
|
62
62
|
"yargs": "^17.7.2"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "be4aa1f92952e9c6e2f7a9b2fe8c28e74a3c7d64"
|
|
65
65
|
}
|