@lzear/forge 0.0.1 → 4.0.2
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/dist/bin.js +18 -8
- package/package.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -12,17 +12,27 @@ import { Command } from "commander";
|
|
|
12
12
|
import pc from "picocolors";
|
|
13
13
|
var require2 = createRequire(import.meta.url);
|
|
14
14
|
var { version } = require2("../package.json");
|
|
15
|
-
var isTTY = process.stdout.isTTY
|
|
15
|
+
var isTTY = process.stdout.isTTY;
|
|
16
16
|
var isDebug = process.env.DEBUG?.includes("forge") ?? false;
|
|
17
17
|
var debug = (...args) => {
|
|
18
18
|
if (isDebug) console.error(pc.dim(`[debug] ${args.join(" ")}`));
|
|
19
19
|
};
|
|
20
20
|
var log2 = {
|
|
21
|
-
intro: (msg) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
intro: (msg) => {
|
|
22
|
+
isTTY ? clack.intro(msg) : console.log(msg);
|
|
23
|
+
},
|
|
24
|
+
outro: (msg) => {
|
|
25
|
+
isTTY ? clack.outro(msg) : console.log(msg);
|
|
26
|
+
},
|
|
27
|
+
success: (msg) => {
|
|
28
|
+
isTTY ? clack.log.success(msg) : console.log(`\u2713 ${msg}`);
|
|
29
|
+
},
|
|
30
|
+
error: (msg) => {
|
|
31
|
+
isTTY ? clack.log.error(msg) : console.error(`\u2717 ${msg}`);
|
|
32
|
+
},
|
|
33
|
+
warn: (msg) => {
|
|
34
|
+
isTTY ? clack.log.warn(msg) : console.warn(`! ${msg}`);
|
|
35
|
+
},
|
|
26
36
|
spinner: () => isTTY ? clack.spinner() : {
|
|
27
37
|
start: (msg) => {
|
|
28
38
|
debug(msg);
|
|
@@ -113,13 +123,13 @@ var promptAndSet = async (s, repo) => {
|
|
|
113
123
|
const value = await clack.password({
|
|
114
124
|
message: `${s.name}: ${pc.dim(s.desc)}`
|
|
115
125
|
});
|
|
116
|
-
if (clack.isCancel(value) || !
|
|
126
|
+
if (clack.isCancel(value) || !value.trim()) {
|
|
117
127
|
log2.warn(`${s.name} skipped.`);
|
|
118
128
|
return;
|
|
119
129
|
}
|
|
120
130
|
spawnSync(
|
|
121
131
|
"gh",
|
|
122
|
-
["secret", "set", s.name, "--repo", repo, "--body",
|
|
132
|
+
["secret", "set", s.name, "--repo", repo, "--body", value.trim()],
|
|
123
133
|
{ stdio: "ignore" }
|
|
124
134
|
);
|
|
125
135
|
log2.success(`${s.name} set.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lzear/forge",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Umbrella package for all lzear dev tooling",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@clack/prompts": "^1",
|
|
55
|
-
"@lzear/configs": "
|
|
56
|
-
"@lzear/eslint-config": "
|
|
57
|
-
"@lzear/repo-lint": "
|
|
55
|
+
"@lzear/configs": "4.0.2",
|
|
56
|
+
"@lzear/eslint-config": "4.0.2",
|
|
57
|
+
"@lzear/repo-lint": "4.0.2",
|
|
58
58
|
"commander": "^14",
|
|
59
59
|
"picocolors": "^1"
|
|
60
60
|
},
|
|
@@ -102,4 +102,4 @@
|
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public"
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
}
|