@zzclub/z-cli 0.5.0 → 0.5.1
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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/command/set.js +4 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v0.5.1
|
|
5
|
+
|
|
6
|
+
[compare changes](https://github.com/aatrooox/z-cli/compare/v0.5.0...v0.5.1)
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
- 修复config设置 ([94318e3](https://github.com/aatrooox/z-cli/commit/94318e3))
|
|
11
|
+
|
|
12
|
+
### ❤️ Contributors
|
|
13
|
+
|
|
14
|
+
- Aatrox <gnakzz@qq.com>
|
|
15
|
+
|
|
4
16
|
## v0.5.0
|
|
5
17
|
|
|
6
18
|
[compare changes](https://github.com/aatrooox/z-cli/compare/v0.4.5...v0.5.0)
|
package/package.json
CHANGED
package/src/command/set.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeFileContent, getLocalConfig } from "../utils/common.js";
|
|
1
|
+
import { writeFileContent, getLocalConfig, setLocalConfig } from "../utils/common.js";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import ora from "ora";
|
|
4
4
|
import path from "node:path";
|
|
@@ -23,24 +23,14 @@ export const setCmd = {
|
|
|
23
23
|
if (payload.length === 2) {
|
|
24
24
|
let key = payload[0];
|
|
25
25
|
if (!["account.key", "account.appId"].includes(key)) {
|
|
26
|
-
set_spinner.warn(`设置appId: zz set translate appId <value>`);
|
|
27
|
-
set_spinner.warn(`设置key: zz set translate key <value>`);
|
|
26
|
+
set_spinner.warn(`设置appId: zz set translate account.appId <value>`);
|
|
27
|
+
set_spinner.warn(`设置key: zz set translate account.key <value>`);
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
let value = payload[1];
|
|
31
31
|
eval(`configItem.${key} = "${value}"`);
|
|
32
32
|
// configItem[key] = value
|
|
33
|
-
|
|
34
|
-
writeFileContent(
|
|
35
|
-
path.resolve(__dirname, "../config.json"),
|
|
36
|
-
configContent,
|
|
37
|
-
(spinner, isOk) => {
|
|
38
|
-
if (isOk) {
|
|
39
|
-
} else {
|
|
40
|
-
spinner.fail("配置失败");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
);
|
|
33
|
+
setLocalConfig(config, set_spinner)
|
|
44
34
|
} else {
|
|
45
35
|
set_spinner.warn(`设置appId: zz set translate account.appId <value>`);
|
|
46
36
|
set_spinner.warn(`设置key: zz set translate account.key <value>`);
|