@simon_he/pi 0.0.1 → 0.0.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 CHANGED
@@ -12,7 +12,12 @@ https://user-images.githubusercontent.com/57086651/200901242-34bc9576-b21c-4e2e-
12
12
 
13
13
  ## 使用
14
14
  ```
15
+ # 安装依赖
15
16
  pi xxx
17
+ # 卸载依赖
18
+ pui xxx
19
+ # 执行命令
20
+ prun
16
21
  ```
17
22
 
18
23
  ## 自定义配置
@@ -27,6 +32,8 @@ export PI_SPINNER=star # loading样式
27
32
  ## 依赖
28
33
  - [@antfu/ni](https://github.com/antfu/ni)
29
34
  - [ora](https://github.com/sindresorhus/ora)
35
+ - [ccommand](https://github.com/Simon-He95/ccommand)
30
36
 
31
37
 
32
-
38
+ ## :coffee:
39
+ <a href="https://github.com/Simon-He95/sponsor" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
package/dist/index.cjs CHANGED
@@ -13,7 +13,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
  const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
14
14
  const ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
15
15
 
16
- const version = "0.0.1";
16
+ const version = "0.0.3";
17
17
 
18
18
  const __filename$1 = url$1.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
19
19
  const __dirname$1 = path__default.dirname(__filename$1);
@@ -28,7 +28,7 @@ async function pi() {
28
28
  const text = pkg ? `Installing ${pkg} ...
29
29
  ` : "\u6B63\u5728\u66F4\u65B0\u4F9D\u8D56...\n";
30
30
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "\u66F4\u65B0\u4F9D\u8D56\u6210\u529F! \u{1F60A}";
31
- const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
31
+ const failMsg = pkg ? `Failed to install ${pkg} , v\u621150 \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
32
32
  const loading = ora__default({
33
33
  text,
34
34
  spinner,
@@ -89,6 +89,9 @@ async function installDeps() {
89
89
  const { status: hasNi } = simonJsTool.jsShell("ni -v", "pipe");
90
90
  if (hasNi === 1)
91
91
  await simonJsTool.jsShell("npm i -g @antfu/ni", "pipe");
92
+ const { status: hasCcommand } = simonJsTool.jsShell("ccommand -v", "pipe");
93
+ if (hasCcommand === 1)
94
+ await simonJsTool.jsShell("npm i -g ccommand", "pipe");
92
95
  }
93
96
  function returnVersion(argv2) {
94
97
  const arg = argv2[0];
@@ -111,7 +114,6 @@ function runner() {
111
114
  const exec = cmd.slice(last, cmd.length);
112
115
  runMap[exec]?.();
113
116
  }
114
- pi();
115
117
  runner();
116
118
 
117
119
  exports.pi = pi;
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'url';
4
4
  import { useNodeWorker, jsShell } from 'simon-js-tool';
5
5
  import ora from 'ora';
6
6
 
7
- const version = "0.0.1";
7
+ const version = "0.0.3";
8
8
 
9
9
  const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = path.dirname(__filename);
@@ -19,7 +19,7 @@ async function pi() {
19
19
  const text = pkg ? `Installing ${pkg} ...
20
20
  ` : "\u6B63\u5728\u66F4\u65B0\u4F9D\u8D56...\n";
21
21
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "\u66F4\u65B0\u4F9D\u8D56\u6210\u529F! \u{1F60A}";
22
- const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
22
+ const failMsg = pkg ? `Failed to install ${pkg} , v\u621150 \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
23
23
  const loading = ora({
24
24
  text,
25
25
  spinner,
@@ -80,6 +80,9 @@ async function installDeps() {
80
80
  const { status: hasNi } = jsShell("ni -v", "pipe");
81
81
  if (hasNi === 1)
82
82
  await jsShell("npm i -g @antfu/ni", "pipe");
83
+ const { status: hasCcommand } = jsShell("ccommand -v", "pipe");
84
+ if (hasCcommand === 1)
85
+ await jsShell("npm i -g ccommand", "pipe");
83
86
  }
84
87
  function returnVersion(argv2) {
85
88
  const arg = argv2[0];
@@ -102,7 +105,6 @@ function runner() {
102
105
  const exec = cmd.slice(last, cmd.length);
103
106
  runMap[exec]?.();
104
107
  }
105
- pi();
106
108
  runner();
107
109
 
108
110
  export { pi, prun, pui, runner };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "packageManager": "pnpm@7.2.1",
6
6
  "description": "",
7
7
  "author": "Simon He",