ccommand 1.0.1 → 1.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/README.md +27 -17
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
## ccommand
|
|
2
|
-
用命令选择需要执行的script, 支持直接选择子目录下的script来执行
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
## ccommand
|
|
2
|
+
用命令选择需要执行的script, 支持直接选择子目录下的script来执行
|
|
3
|
+
|
|
4
|
+
## feature
|
|
5
|
+
兼容了yarn和npm的命令行工具
|
|
6
|
+
|
|
7
|
+
## warning
|
|
8
|
+
依赖 [gum](https://github.com/charmbracelet/gum), 需要全局安装gum才可生效
|
|
9
|
+
|
|
10
|
+
## 安装gum
|
|
11
|
+
```bash
|
|
12
|
+
npm i -g gum
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
```bash
|
|
17
|
+
npm i -g ccommand
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 使用
|
|
21
|
+
- ccommand # 默认当前目录
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
- ccommand ./playground # 执行子目录 playground 下的 script
|
|
26
|
+
|
|
27
|
+

|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var h=require("child_process"),_=require("fs"),a=require("simon-js-tool");function o(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var i=o(h),u=o(_);async function l(){const e=process.argv[2]||".";let s=!1;try{u.default.accessSync(a.getResolvedPath("./yarn.lock"),u.default.constants.F_OK),s=!0}catch{}const{scripts:n}=await a.getPkg(`${e}/package.json`),c=[],d=i.default.spawnSync(`gum choose ${Object.keys(n).reduce((t,r)=>{const p=n[r];return c.push(r),t+=`"${r}: ${p}" `,t},"")}`,{shell:!0,stdio:["inherit","pipe","inherit"],encoding:"utf8"}).output[1];i.default.spawnSync(`${s?"yarn":"npm"} run ${f(d)} --prefix ${e}`,{shell:!0,stdio:"inherit"});function f(t){return c.find(r=>t.startsWith(r))}}l(),exports.ccommand=l;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import o from"child_process";import i from"fs";import{getResolvedPath as f,getPkg as h}from"simon-js-tool";async function a(){const n=process.argv[2]||".";let s=!1;try{i.accessSync(f("./yarn.lock"),i.constants.F_OK),s=!0}catch{}const{scripts:e}=await h(`${n}/package.json`),c=[],p=o.spawnSync(`gum choose ${Object.keys(e).reduce((t,r)=>{const m=e[r];return c.push(r),t+=`"${r}: ${m}" `,t},"")}`,{shell:!0,stdio:["inherit","pipe","inherit"],encoding:"utf8"}).output[1];o.spawnSync(`${s?"yarn":"npm"} run ${u(p)} --prefix ${n}`,{shell:!0,stdio:"inherit"});function u(t){return c.find(r=>t.startsWith(r))}}a();export{a as ccommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccommand",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"packageManager": "pnpm@6.32.3",
|
|
5
5
|
"description": "ccommand",
|
|
6
6
|
"author": "Simon He",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vue": "^3.2.36"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@antfu/eslint-config": "^0.
|
|
56
|
+
"@antfu/eslint-config": "^0.26.1",
|
|
57
57
|
"@types/node": "^17.0.38",
|
|
58
58
|
"@vitejs/plugin-vue": "^3.0.1",
|
|
59
59
|
"bumpp": "^7.1.1",
|
|
@@ -67,4 +67,4 @@
|
|
|
67
67
|
"eslintConfig": {
|
|
68
68
|
"extends": "@antfu"
|
|
69
69
|
}
|
|
70
|
-
}
|
|
70
|
+
}
|