@done-coding/cli-inject 0.1.1 → 0.2.0
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/README.md +0 -0
- package/es/cli.mjs +0 -0
- package/es/handler.mjs +3 -3
- package/es/index.mjs +0 -0
- package/es/injectInfo.json.mjs +1 -1
- package/es/main.mjs +0 -0
- package/package.json +2 -2
- package/types/cli.d.ts +0 -0
- package/types/handler.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/injectInfo.json.d.ts +1 -1
- package/types/main.d.ts +0 -0
- package/types/utils/index.d.ts +0 -0
- package/types/utils/types.d.ts +0 -0
package/README.md
CHANGED
|
File without changes
|
package/es/cli.mjs
CHANGED
|
File without changes
|
package/es/handler.mjs
CHANGED
|
@@ -7,9 +7,9 @@ import e from "chalk";
|
|
|
7
7
|
const P = async (a) => {
|
|
8
8
|
const { sourceJsonFilePath: c, injectKeyPath: g, injectInfoFilePath: l } = a, i = process.cwd();
|
|
9
9
|
if (!c.endsWith(".json"))
|
|
10
|
-
return console.log(e.red("源文件必须是json
|
|
10
|
+
return console.log(e.red("源文件必须是json")), process.exit(1);
|
|
11
11
|
if (!l.endsWith(".json"))
|
|
12
|
-
return console.log(e.red("注入文件必须是json
|
|
12
|
+
return console.log(e.red("注入文件必须是json")), process.exit(1);
|
|
13
13
|
const h = u.resolve(i, c), p = JSON.parse(
|
|
14
14
|
r.readFileSync(h, "utf-8")
|
|
15
15
|
), s = g.reduce((n, f) => (j(n, f, d(p, f)), n), {}), o = u.resolve(i, l), t = JSON.stringify(s, null, 2);
|
|
@@ -21,7 +21,7 @@ const P = async (a) => {
|
|
|
21
21
|
} else
|
|
22
22
|
console.log(e.green("开始注入文件"));
|
|
23
23
|
return r.writeFileSync(o, t), console.log(
|
|
24
|
-
e.green(
|
|
24
|
+
e.green(`文件注入成功: ${o}`),
|
|
25
25
|
e.blue(t)
|
|
26
26
|
), s;
|
|
27
27
|
};
|
package/es/index.mjs
CHANGED
|
File without changes
|
package/es/injectInfo.json.mjs
CHANGED
package/es/main.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-inject",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "信息注入命令行工具",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"prompts": "^2.4.2",
|
|
61
61
|
"yargs": "^17.7.2"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "caa230835cb90705a00646511ae437a13439b267"
|
|
64
64
|
}
|
package/types/cli.d.ts
CHANGED
|
File without changes
|
package/types/handler.d.ts
CHANGED
|
File without changes
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/types/main.d.ts
CHANGED
|
File without changes
|
package/types/utils/index.d.ts
CHANGED
|
File without changes
|
package/types/utils/types.d.ts
CHANGED
|
File without changes
|