jja 2.2.1 → 2.2.3
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 +15 -3
- package/bin.mjs +2 -0
- package/package.json +7 -8
- package/src/command.mjs +1 -1
- package/src/github/byDns.mjs +1 -0
- package/src/github/byHttp.mjs +1 -0
- package/src/github/byPing.mjs +1 -0
- package/src/github/getIp.mjs +1 -0
- package/src/github/index.mjs +1 -0
- package/src/github/wheel.mjs +1 -0
- package/src/main.mjs +1 -0
- package/src/package/diff/data-store.mjs +1 -1
- package/src/package/diff/dependencies.mjs +1 -1
- package/src/package/diff/diffVersion.mjs +1 -1
- package/src/package/diff/everyThreePlusBackslash.mjs +1 -0
- package/src/package/diff/getInstallVersion.mjs +1 -1
- package/src/package/diff/getLatestVersion.mjs +1 -1
- package/src/package/diff/index.mjs +1 -1
- package/src/package/diff/installation.mjs +1 -0
- package/src/package/diff/latestPen.mjs +1 -0
- package/src/package/diff/tagPen.mjs +1 -0
- package/src/package/updateDependence.mjs +1 -1
- package/src/pen.mjs +1 -0
- package/src/printInOneLine.mjs +1 -0
- package/src/remove/beforeRemove.mjs +1 -1
- package/src/remove/index.mjs +1 -1
- package/src/remove/removeFileOrDirectory.mjs +1 -1
- package/src/remove/wheelRun.mjs +1 -1
- package/bin.js +0 -4
- package/index.mjs +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# jja
|
|
2
2
|
|
|
3
|
-
[&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/jja) [&label=版本号&labelColor=rgb(73,73,228)&color=rgb(0,0,0)>)](https://www.npmjs.com/package/jja) [?logo=github>)](https://github.com/earthnutDev/jja/issues)
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -12,11 +12,13 @@ npm install --save-dev jja
|
|
|
12
12
|
|
|
13
13
|
## 📖 命令
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
- [remove :与删除文件相关](#remove)
|
|
16
|
+
- [package:与 package.json 包相关](#package)
|
|
17
|
+
- `cls`、`clear`:清理终端屏幕,两个作用相同
|
|
16
18
|
|
|
17
19
|
### `remove`
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
可用 `npx jja rm <filename> <filename> <...>` 的模式进行移除文件或文件夹
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
24
|
npx jja rm <filename>
|
|
@@ -28,6 +30,16 @@ npx jja rm <filename>
|
|
|
28
30
|
npx jja rm -i filename
|
|
29
31
|
```
|
|
30
32
|
|
|
33
|
+
### `package`
|
|
34
|
+
|
|
35
|
+
使用 `--diff` 或 `-d` 进行 `package.json` 文件内的依赖版本的检测,查看是否有更新(更新以本地安装的应用版本为准,而不是以 package.json 文件给出的范围)可用,给出反馈
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx jja package --diff
|
|
39
|
+
# 或者使用缩写
|
|
40
|
+
npx jjs pkg -d
|
|
41
|
+
```
|
|
42
|
+
|
|
31
43
|
### `update`
|
|
32
44
|
|
|
33
45
|
```bash
|
package/bin.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jja",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.3",
|
|
5
5
|
"description": "一些在终端的执行动作 🥜",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@qqi/dev-log": ">=0.1.0 <1.0.0",
|
|
9
|
-
"a-command": "^2.1.
|
|
10
|
-
"a-js-tools": ">=0.
|
|
11
|
-
"a-node-tools": ">=2.2.
|
|
9
|
+
"a-command": "^2.1.5",
|
|
10
|
+
"a-js-tools": ">=0.6.0 <1.0.0",
|
|
11
|
+
"a-node-tools": ">=2.2.1 <3.0.0",
|
|
12
12
|
"a-type-of-js": ">=0.2.0 <1.0.0",
|
|
13
|
-
"color-pen": "^1.
|
|
13
|
+
"color-pen": "^1.3.1"
|
|
14
14
|
},
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "🥜",
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
"url": "https://earthnut.dev"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"bin.js",
|
|
22
21
|
"src",
|
|
23
|
-
"
|
|
22
|
+
"bin.mjs"
|
|
24
23
|
],
|
|
25
24
|
"keywords": [
|
|
26
25
|
"ixxx",
|
|
@@ -40,6 +39,6 @@
|
|
|
40
39
|
"registry": "https://registry.npmjs.org/"
|
|
41
40
|
},
|
|
42
41
|
"bin": {
|
|
43
|
-
"jja": "bin.
|
|
42
|
+
"jja": "bin.mjs"
|
|
44
43
|
}
|
|
45
44
|
}
|
package/src/command.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Command as e}from"a-command";import r from"color-pen";import{dog as
|
|
1
|
+
import{Command as e}from"a-command";import r from"color-pen";import{dog as m}from"./dog.mjs";import{redPen as i,hexPen as n}from"./pen.mjs";const o=new e("jja");o.bind({"package <pkg> (包管理)":["--diff <-d> (分析当下包的差异)","--upDependencies <-u> (更新依赖,强制更新到 'latest',使用需谨慎)"],"remove <rm> (做一个简单的兼容的移除文件或文件夹的命令)":["--ignore <-i> (不打印日志(默认打印的))","--subdirectories <-s> (这是一个危险的命令,用于 windows 下递归删除执行命令下所有的给定文件名称)"],"update <up> (做一个简单的 npm 升级程序,对,简单的)":["--ignore <-i> (不建议你这么用,你会发现你像个傻子一样在那等结果)",`--dependencies <-d> (更新依赖,跟 ${r.random("npm update")} 一样)`],"clearScreen <cls> (清理终端显示屏幕,同 clearTerminal )":"","clearTerminal <clear> (清理终端显示屏幕,同 clearScreen )":"","git (一些关于 git 的操作)":[`commit (git 提交代码,是 ${i("commit")} 提交啊,不是 ${n("#666")("push")} 推送)`,"merge (合并两个分支)","tag (给提交打上 tag)"]}).run(),m("参数已绑定,且已解析用户参数",o.args),m.warn("当前的执行状态",o.state),o.isEnd(!0);export{o as command};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function n(){}export{n as byDns};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function n(){}export{n as byHttp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function n(){}export{n as byPing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{byDns as t}from"./byDns.mjs";import{byHttp as m}from"./byHttp.mjs";import{byPing as i}from"./byPing.mjs";async function o(){await t(),await i(),await m()}export{o as getIp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dog as o}from"../dog.mjs";import{isUndefined as t}from"a-type-of-js";import{wheel as r}from"./wheel.mjs";import{getIp as m}from"./getIp.mjs";async function i(i){const f=i.options;if(t(f)||0===f.length)return o.warn("没有配置项,直接使用所有的方式获取 github.com 的 IP 地址"),await m();for(const t of f)o("当前选项",t),await r(t)}export{i as github};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dog as t}from"../dog.mjs";import{byDns as i}from"./byDns.mjs";import{byHttp as m}from"./byHttp.mjs";import{byPing as o}from"./byPing.mjs";async function p(p){p["--dns"]?(t("执行使用 dns 查询 github.com 的 ip"),await i()):p["--http"]?(t("执行使用 http 查询 github.com 的 ip"),await m()):p["--ping"]&&(t("执行使用 ping 查询 github.com 的 ip"),await o())}export{p as wheel};
|
package/src/main.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dog as a}from"./dog.mjs";import{command as i}from"./command.mjs";import{remove as t}from"./remove/index.mjs";import r from"./update/index.mjs";import{packageManage as e}from"./package/index.mjs";import{clearScreen as m}from"./clearScreen.mjs";import o from"./git/index.mjs";import{isUndefined as n}from"a-type-of-js";import{github as p}from"./github/index.mjs";const g=i.args.$arrMap;0===i.args.$only.length&&(a("没有匹配到子命令,打印帮助信息并退出"),i.help(),i.end());try{await async function c(){0===g.length&&i.end();const s=g.shift();if(n(s))return await c();"remove"in s?(a("执行文件移除"),await t(s.remove)):"clearScreen"in s||"clear"in s?(a("执行清屏"),await m()):"git"in s?(a("执行 git 相关命令"),await o(s.git)):"package"in s?(a("执行 package 相关命令"),await e(s.package)):"update"in s?(a("执行 update 相关命令"),await r(s.update)):"githubIp"in s&&(a("执行 github 相关的命令"),await p(s.githubIp)),await c()}()}catch(i){a.error("执行 run 报错",i)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isUndefined as e}from"a-type-of-js";const n={local:null,online:null,
|
|
1
|
+
import{isUndefined as e}from"a-type-of-js";const n={local:null,online:null,dependenceList:{},updateDependence:[],latestDependence:[],binning:function(n,t=!1){if(!e(n))for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const o=n[e];this.dependenceList[e]={type:t?"devDependencies":"dependencies",version:o,localVersion:"",latestVersion:"",onlineVersion:"",tag:"",time:""}}},preReleaseDependence:[]};export{n as diffData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{italicPen as e}from"../../pen.mjs";import{_p as t}from"a-node-tools";import{diffVersion as n}from"./diffVersion.mjs";import i,{strInOneLineOnTerminal as o}from"color-pen";import{diffData as r}from"./data-store.mjs";import{isNull as s}from"a-type-of-js";import{installation as a}from"./installation.mjs";import{latestPen as m}from"./latestPen.mjs";import{tagPen as l}from"./tagPen.mjs";async function p(){const{local:p,preReleaseDependence:c,latestDependence:g,dependenceList:d}=r;if(s(p))return;const{dependencies:f,devDependencies:h}=p;if(r.binning(f),r.binning(h,!0),await n(),0===c.length&&0===g.length)return void t("看起来似乎没有依赖版本差异");t(i.brightGreen`\n版本差异的依赖为:\n`),t([...g,...c].map((t=>{const n=d[t],r=i.random`- `.concat(`${"dependencies"===n.type?i.bold(t):i.italic(t)}:于${i.color("#066")(n.time)} 发布 ${n.latestVersion||e(n.onlineVersion)}`);return o(r)})).join("\n")),t(i.brightRed(`\n目前仅关注版本号是否为最新 ${i.brightMagenta("latest")}`)),t("使用 npm install --save 命令安装更新\n");const b=[...g.filter((e=>!1===c.includes(e))).map((e=>i.bold(e).concat("@latest"))),...c.map((e=>l(e,d[e].tag)))],j=g.map((e=>m(e))),u=[...g.map((e=>m(e))),...c.filter((e=>!1===g.includes(e))).map((e=>l(e,d[e].tag)))];if(c.length>0){const e=c.length+g.length;b.length<e&&a({msg:"‼️ 预发布版本优先:",list:b,type:"brightRed"}),a({msg:"⚠️ latest 版本优先:",list:u,type:"brightMagenta"})}g.length>0&&a({msg:"🎉 最佳安装:",list:j,type:"brightGreen"})}export{p as dependencies};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{greenPen as e,pen399 as n}from"../../pen.mjs";import{cursorMoveUp as t,cursorLineClear as o,cursorAfterClear as s}from"a-node-tools";import{getInstallVersion as i}from"./getInstallVersion.mjs";import{getLatestVersion as r}from"./getLatestVersion.mjs";import{diffData as l}from"./data-store.mjs";import{printInOneLine as p}from"../../printInOneLine.mjs";async function m(){const{dependenceList:m}=l,a=Object.keys(m);let c=!1;for(let f=0,V=a.length;f<V;f++){const V=a[f],$=m[V],d=m[V].version;await r(V);const u=i(V);if(c&&(t(),o(),s(!0)),u===$.onlineVersion){let n=`${V} 的本地${d} 安装版本为 ${u} 最新是 ${$.onlineVersion} `;if(""===$.latestVersion){p(n),c=!0;continue}c=!1,l.preReleaseDependence.push(V),n+=`;最新预发布版本为 ${e($.latestVersion)}`,p(n);continue}if(c=!1,u===$.latestVersion)continue;let j=`${V} 的本地 ${e(d)} 安装版本为 ${e(u)} 最新是 ${n($.onlineVersion)} `;l.latestDependence.push(V),""!==$.latestVersion?(l.preReleaseDependence.push(V),j+=`;最新预发布版本为 ${e($.latestVersion)}`,p(j)):p(j)}!0===c&&(t(),o(),s(!0),c=!1)}export{m as diffVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isArray as o,isString as r}from"a-type-of-js";function n(n){if(!o(n)||n.some((o=>!r(o))))throw new TypeError("参数必须为字符串数组");return n.map(((o,r)=>r%3==2&&r!==n.length-1?`${o} \\\n`:o.concat(" "))).join("")}export{n as everyThreePlusBackslash};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as o}from"../../dog.mjs";import{readFileToJsonSync as e,pathJoin as r}from"a-node-tools";import{isNull as t}from"a-type-of-js";import{diffData as m}from"./data-store.mjs";function n(n){const s=e(r("node_modules/",n,"package.json"));let i="";return i=t(s)?"":s.version||"",m.
|
|
1
|
+
import{dog as o}from"../../dog.mjs";import{readFileToJsonSync as e,pathJoin as r}from"a-node-tools";import{isNull as t}from"a-type-of-js";import{diffData as m}from"./data-store.mjs";function n(n){const s=e(r("node_modules/",n,"package.json"));let i="";return i=t(s)?"":s.version||"",m.dependenceList[n].localVersion=i,o(n,"本地安装的版本为:",i),i}export{n as getInstallVersion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as t}from"../../dog.mjs";import{getNpmPkgInfo as o}from"a-node-tools";import{isNull as e}from"a-type-of-js";import{diffData as
|
|
1
|
+
import{dog as t}from"../../dog.mjs";import{getNpmPkgInfo as o}from"a-node-tools";import{isNull as e}from"a-type-of-js";import{diffData as n}from"./data-store.mjs";async function s(s){const r=await o(s);if(e(r))return void t.warn("获取包信息失败");const a=n.dependenceList[s],{"dist-tags":i,time:m}=r;let c=r.version,l="latest";a.onlineVersion=c,a.tag=l;const f=Object.keys(i);for(let t=0,o=f.length;t<o;t++){const o=f[t],e=i[o];m[e]>m[c]&&(c=e,l=o)}"latest"!==l&&(t(s,"最新版本为:",c,"tag为:",l),a.tag=l,a.latestVersion=c);const d=new Date(m[c]).toLocaleString();a.time=d,t(`${s} 的最后发布时间为:${d}`)}export{s as getLatestVersion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as o}from"../../dog.mjs";import
|
|
1
|
+
import{dog as o}from"../../dog.mjs";import{getVersion as t}from"./getVersion.mjs";import{_p as e}from"a-node-tools";import{isNull as r}from"a-type-of-js";import{dependencies as i}from"./dependencies.mjs";import{diffData as n}from"./data-store.mjs";import{orangePen as m,pen399 as s}from"../../pen.mjs";async function a(){await t();const{local:a,online:p}=n,f=a?.version||"",c=p?.version||"";if(r(a))return o("未找到包 package.json 文件退出"),e(m("未找到当前包 package.json"));const j=m(`当前包本地版本为: ${f}`);if(e(j),r(p))e(s("未获取当前包的线上信息"));else{const o=" ".repeat(6);e(s(`${o}线上版本为:${c}@latest`));const t=new Date(p&&p.time.modified||"").toLocaleString();e(t.toString())}await i()}export{a as diffPackage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_p as o}from"a-node-tools";import{everyThreePlusBackslash as e}from"./everyThreePlusBackslash.mjs";import r from"color-pen";function s(s){const{msg:t,list:m,type:n}=s,l=r[n];o(),o(l.reversed(t)),o(),o(`${l`npm install --save`} \\\n${e(m)}`),o()}export{s as installation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{boldPen as t,boldGreenPen as r}from"../../pen.mjs";function e(e){return`${t(e)}@${r`latest`}`}export{e as latestPen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{italicPen as r}from"../../pen.mjs";function n(n,o){return`${r(n)}@${r.random(o)}`}export{n as tagPen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{greenPen as e,cyanPen as t}from"../pen.mjs";import{getDirectoryBy as n,_p as a,readFileToJsonSync as o,pathJoin as s,runOtherCode as i}from"a-node-tools";import{cursorMoveUp as l}from"./utils.mjs";async function p(p=!0){const c=n("package.json","file");if(null==c)return a("当前目录下不存在 package.json 文件");const m=o(s(c,"package.json"))?.dependencies||{};if(p&&a(e("初始化完成,等待下一步命令")),Object.keys(m).length>0){let e="npm install --save";for(let t=Object.keys(m),n=t.length,a=0;a<n;a++){e+=` ${t[a]}@latest `}await i(e)}p&&a(t("正在更新 dev 依赖")),await i("npm update --save"),p&&l("开发依赖更新完毕")}export{p as updateDependence};
|
package/src/pen.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"color-pen";const o=e.bold,r=o.green,l=e.italic,n=e.green,c=e.red,t=e.yellow,i=e.hex,p=e.cyan,a=i(10040081),d=i(3381657);export{r as boldGreenPen,o as boldPen,p as cyanPen,n as greenPen,i as hexPen,l as italicPen,a as orangePen,d as pen399,c as redPen,t as yellowPen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_p as o}from"a-node-tools";import{strInOneLineOnTerminal as r}from"color-pen";function t(t){o(r(t))}export{t as printInOneLine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as o}from"../dog.mjs";import
|
|
1
|
+
import{dog as o}from"../dog.mjs";import{removeData as m}from"./removeData.mjs";import{_p as r,fileExist as t}from"a-node-tools";import{wheelRun as e}from"./wheelRun.mjs";import{removeFileOrDirectory as i}from"./removeFileOrDirectory.mjs";import{isUndefined as p}from"a-type-of-js";import{hexPen as f,yellowPen as s}from"../pen.mjs";async function a(a){m.log||r(f("#336")(`当前清理文件为 ${a}`));const n=t(a);m.log||r(f("#666")(`正在检测 ${a} 文件/夹是否存在`)),o(`文件${a} 数据为 ${n}`),p(n)?m.log||r(s(`${a} 文件不存在`)):await e(i,[a,n])}export{a as beforeRemove};
|
package/src/remove/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dog as o}from"../dog.mjs";import{pen as r}from"color-pen";import{_p as t,isWindows as n}from"a-node-tools";import{removeData as e}from"./removeData.mjs";import{beforeRemove as i}from"./beforeRemove.mjs";async function m(m){const a=m.value||[],c=m.options;for(c?.forEach((o=>{const r=o["--ignore"];r&&(e.log=!0,a.concat(r));const t=o["--subdirectories"];t&&(e.subdirectories=!0,a.concat(t))})),e.log||t(r.brightCyan`当前系统为: ${n?"windows":"linux/mac"}`),0==a.length&&(o.warn("待删除列表",a),t(r.random
|
|
1
|
+
import{dog as o}from"../dog.mjs";import{pen as r}from"color-pen";import{_p as t,isWindows as n}from"a-node-tools";import{removeData as e}from"./removeData.mjs";import{beforeRemove as i}from"./beforeRemove.mjs";async function m(m){const a=m.value||[],c=m.options;for(c?.forEach((o=>{const r=o["--ignore"];r&&(e.log=!0,a.concat(r));const t=o["--subdirectories"];t&&(e.subdirectories=!0,a.concat(t))})),e.log||t(r.brightCyan`当前系统为: ${n?"windows":"linux/mac"}`),0==a.length&&(o.warn("待删除列表",a),t(r.random`没有待清理的文件/文件夹`));a.length;){let o=a.pop();o=void 0===o?"undefined":o.toString(),await i(o)}}export{m as remove};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{removeData as r}from"./removeData.mjs";import
|
|
1
|
+
import{removeData as r}from"./removeData.mjs";import{_p as e,isWindows as o,runOtherCode as s}from"a-node-tools";import{removeResult as c}from"./removeResult.mjs";import{hexPen as t}from"../pen.mjs";async function i(i,a){r.log||e(t("#aaa")(` ${i} 文件/夹存在,准备删除`));let m={error:null};return o?a.isDirectory()?(m=await s({code:`rd /q /s ${i.replace(/\//,"\\")}`,printLog:!1}),c(i,m.success)):a.isFile()&&(m=await s({code:`del ${r.subdirectories?"/s":""} /q ${i.replace(/\//,"\\")}`,printLog:!1}),c(i,m.success)):(m=await s({code:`rm -rf ${i.replace(/\\/,"/")}`,printLog:!1}),c(i,m.success)),!!m.success||void 0!==console.log(m.error)}export{i as removeFileOrDirectory};
|
package/src/remove/wheelRun.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{greenPen as o}from"../pen.mjs";import{dog as t}from"../dog.mjs";import{_p as a}from"a-node-tools";async function r(i,p,e=5){return!await Reflect.apply(i,void 0,p)&&e--?(a(o("执行失败,现在重试中")),t.warn(p,"执行失败,第",5-e,"次执行"),await r(i,p,e)):await Reflect.apply(i,void 0,p)}export{r as wheelRun};
|
package/bin.js
DELETED
package/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{dog as r}from"./src/dog.mjs";import{command as a}from"./src/command.mjs";import{remove as t}from"./src/remove/index.mjs";import e from"./src/update/index.mjs";import{packageManage as i}from"./src/package/index.mjs";import{clearScreen as m}from"./src/clearScreen.mjs";import o from"./src/git/index.mjs";import{isUndefined as n}from"a-type-of-js";const c=a.args.$arrMap;0===a.args.$only.length&&(r("没有匹配到子命令,打印帮助信息并退出"),a.help(),a.end());try{await async function s(){0===c.length&&a.end();const p=c.shift();if(n(p))return await s();"remove"in p?(r("执行文件移除"),await t(p.remove)):"clearScreen"in p||"clear"in p?(r("执行清屏"),await m()):"git"in p?(r("执行 git 相关命令"),await o(p.git)):"package"in p?(r("执行 package 相关命令"),await i(p.package)):"update"in p&&(r("执行 update 相关命令"),await e(p.update)),await s()}()}catch(a){r.error("执行 run 报错",a)}
|