@simon_he/pi 0.0.82 → 0.0.83

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/dist/index.cjs CHANGED
@@ -5658,7 +5658,7 @@ __export(src_exports, {
5658
5658
  module.exports = __toCommonJS(src_exports);
5659
5659
  var import_process4 = __toESM(require("process"), 1);
5660
5660
  var import_lazy_js_utils14 = require("lazy-js-utils");
5661
- var import_picocolors7 = __toESM(require_picocolors(), 1);
5661
+ var import_picocolors8 = __toESM(require_picocolors(), 1);
5662
5662
  var import_fast_glob = __toESM(require("fast-glob"), 1);
5663
5663
  var import_ccommand2 = require("ccommand");
5664
5664
 
@@ -6751,7 +6751,7 @@ function getLatestVersion(pkg, isZh6 = true) {
6751
6751
  var import_lazy_js_utils2 = require("lazy-js-utils");
6752
6752
 
6753
6753
  // package.json
6754
- var version = "0.0.82";
6754
+ var version = "0.0.83";
6755
6755
 
6756
6756
  // src/help.ts
6757
6757
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6808,15 +6808,23 @@ async function installDeps() {
6808
6808
  // src/pi.ts
6809
6809
  var import_process2 = __toESM(require("process"), 1);
6810
6810
  var import_lazy_js_utils5 = require("lazy-js-utils");
6811
- var import_picocolors3 = __toESM(require_picocolors(), 1);
6811
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
6812
6812
 
6813
6813
  // src/detectNode.ts
6814
6814
  var import_process = __toESM(require("process"), 1);
6815
6815
  var import_lazy_js_utils4 = require("lazy-js-utils");
6816
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
6816
6817
  var semver = require("semver");
6817
6818
  async function detectNode() {
6818
6819
  var _a;
6819
- const pkg = await (0, import_lazy_js_utils4.getPkg)();
6820
+ let pkg;
6821
+ try {
6822
+ pkg = await (0, import_lazy_js_utils4.getPkg)();
6823
+ } catch (e) {
6824
+ const cwd = import_process.default.cwd();
6825
+ console.log(import_picocolors3.default.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
6826
+ import_process.default.exit(1);
6827
+ }
6820
6828
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6821
6829
  const isSafe = semver.satisfies(import_process.default.version, pkg.engines.node);
6822
6830
  if (!isSafe) {
@@ -6828,13 +6836,13 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6828
6836
  if (status === 0 && result === "yes") {
6829
6837
  await (0, import_lazy_js_utils4.jsShell)(
6830
6838
  `
6831
- current=$(echo $(fnm current))
6832
- registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6833
- registery=$(echo \${registery// /} | sed 's/*//g')
6834
- if [ $registery ]; then
6835
- fnm use \${registery% -*}
6836
- fi
6837
- `,
6839
+ current=$(echo $(fnm current))
6840
+ registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6841
+ registery=$(echo \${registery// /} | sed 's/*//g')
6842
+ if [ $registery ]; then
6843
+ fnm use \${registery% -*}
6844
+ fi
6845
+ `,
6838
6846
  "pipe"
6839
6847
  );
6840
6848
  }
@@ -6884,15 +6892,15 @@ async function pi(params, pkg, executor = "ni") {
6884
6892
  loading_status = await loading("");
6885
6893
  const end = Date.now();
6886
6894
  const costTime = (end - start) / 1e3;
6887
- successMsg += import_picocolors3.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6895
+ successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6888
6896
  if (status === 0) {
6889
- loading_status.succeed(import_picocolors3.default.green(successMsg));
6897
+ loading_status.succeed(import_picocolors4.default.green(successMsg));
6890
6898
  } else if (result && result.includes("Not Found - 404")) {
6891
6899
  const _result = isZh3 ? `${pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${pkg} the package name may be wrong, and cannot be found in npm, please check`;
6892
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6900
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6893
6901
  ${_result}` : failMsg));
6894
6902
  } else {
6895
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6903
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6896
6904
  ${result}` : failMsg));
6897
6905
  }
6898
6906
  if (result) {
@@ -6925,7 +6933,7 @@ function pfind(params) {
6925
6933
 
6926
6934
  // src/pil.ts
6927
6935
  var import_lazy_js_utils8 = require("lazy-js-utils");
6928
- var import_picocolors4 = __toESM(require_picocolors(), 1);
6936
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
6929
6937
  async function pil(params) {
6930
6938
  const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils8.getPkg)();
6931
6939
  if (!params) {
@@ -6942,7 +6950,7 @@ async function pil(params) {
6942
6950
  "pipe"
6943
6951
  );
6944
6952
  if (status === 130) {
6945
- console.log(import_picocolors4.default.dim("\u5DF2\u53D6\u6D88"));
6953
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
6946
6954
  process.exit(0);
6947
6955
  } else if (status !== 0) {
6948
6956
  throw new Error(choose);
@@ -7017,7 +7025,7 @@ function pu() {
7017
7025
 
7018
7026
  // src/pui.ts
7019
7027
  var import_lazy_js_utils12 = require("lazy-js-utils");
7020
- var import_picocolors5 = __toESM(require_picocolors(), 1);
7028
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
7021
7029
  var isZh4 = process.env.PI_Lang === "zh";
7022
7030
  async function pui(params, pkg) {
7023
7031
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
@@ -7036,7 +7044,7 @@ async function pui(params, pkg) {
7036
7044
  "pipe"
7037
7045
  );
7038
7046
  if (status2 === 130) {
7039
- console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7047
+ console.log(import_picocolors6.default.dim("\u5DF2\u53D6\u6D88"));
7040
7048
  process.exit(0);
7041
7049
  } else if (status2 !== 0) {
7042
7050
  throw new Error(choose);
@@ -7048,7 +7056,7 @@ async function pui(params, pkg) {
7048
7056
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
7049
7057
  if (!pkg) {
7050
7058
  console.log(
7051
- import_picocolors5.default.yellow(
7059
+ import_picocolors6.default.yellow(
7052
7060
  isZh4 ? "\u9700\u8981\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u5305\u540D\uFF01" : "Need to specify an uninstall package name!"
7053
7061
  )
7054
7062
  );
@@ -7058,11 +7066,11 @@ async function pui(params, pkg) {
7058
7066
  const { status, result } = await (0, import_lazy_js_utils12.useNodeWorker)(`nun ${params}`);
7059
7067
  const end = Date.now();
7060
7068
  const costTime = (end - start) / 1e3;
7061
- successMsg += import_picocolors5.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7069
+ successMsg += import_picocolors6.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7062
7070
  if (status === 0)
7063
- loading_status.succeed(import_picocolors5.default.green(successMsg));
7071
+ loading_status.succeed(import_picocolors6.default.green(successMsg));
7064
7072
  else
7065
- loading_status.fail(import_picocolors5.default.red(result ? `${failMsg}
7073
+ loading_status.fail(import_picocolors6.default.red(result ? `${failMsg}
7066
7074
  ${result}` : failMsg));
7067
7075
  process.exit();
7068
7076
  }
@@ -7070,7 +7078,7 @@ ${result}` : failMsg));
7070
7078
  // src/pio.ts
7071
7079
  var import_process3 = __toESM(require("process"), 1);
7072
7080
  var import_lazy_js_utils13 = require("lazy-js-utils");
7073
- var import_picocolors6 = __toESM(require_picocolors(), 1);
7081
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
7074
7082
  async function pio(params, pkg, executor = "ni") {
7075
7083
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
7076
7084
  const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
@@ -7082,9 +7090,9 @@ async function pio(params, pkg, executor = "ni") {
7082
7090
  });
7083
7091
  const loading_status = await loading("");
7084
7092
  if (status === 0)
7085
- loading_status.succeed(import_picocolors6.default.green(successMsg));
7093
+ loading_status.succeed(import_picocolors7.default.green(successMsg));
7086
7094
  else
7087
- loading_status.fail(import_picocolors6.default.red(result ? `${result}
7095
+ loading_status.fail(import_picocolors7.default.red(result ? `${result}
7088
7096
 
7089
7097
  ${failMsg}` : failMsg));
7090
7098
  import_process3.default.exit();
@@ -7129,11 +7137,11 @@ async function setup() {
7129
7137
  const { status } = params ? await (0, import_lazy_js_utils14.useNodeWorker)(`go get ${params}`) : await (0, import_lazy_js_utils14.useNodeWorker)("go mod tidy");
7130
7138
  if (status === 0) {
7131
7139
  loading_status.succeed(
7132
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7140
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7133
7141
  );
7134
7142
  } else {
7135
7143
  loading_status.fail(
7136
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7144
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7137
7145
  );
7138
7146
  }
7139
7147
  } else if (exec === "pui") {
@@ -7144,11 +7152,11 @@ async function setup() {
7144
7152
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`go clean ${params}`);
7145
7153
  if (status === 0) {
7146
7154
  loading_status.succeed(
7147
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7155
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7148
7156
  );
7149
7157
  } else {
7150
7158
  loading_status.fail(
7151
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7159
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7152
7160
  );
7153
7161
  }
7154
7162
  } else if (exec === "prun") {
@@ -7161,7 +7169,7 @@ async function setup() {
7161
7169
  (0, import_lazy_js_utils14.jsShell)(`go build ${params}`);
7162
7170
  } else {
7163
7171
  console.log(
7164
- import_picocolors7.default.red(
7172
+ import_picocolors8.default.red(
7165
7173
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7166
7174
  )
7167
7175
  );
@@ -7177,11 +7185,11 @@ async function setup() {
7177
7185
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo install ${params}`);
7178
7186
  if (status === 0) {
7179
7187
  loading_status.succeed(
7180
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7188
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7181
7189
  );
7182
7190
  } else {
7183
7191
  loading_status.fail(
7184
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7192
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7185
7193
  );
7186
7194
  }
7187
7195
  } else if (exec === "pui") {
@@ -7192,11 +7200,11 @@ async function setup() {
7192
7200
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo uninstall ${params}`);
7193
7201
  if (status === 0) {
7194
7202
  loading_status.succeed(
7195
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7203
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7196
7204
  );
7197
7205
  } else {
7198
7206
  loading_status.fail(
7199
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7207
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7200
7208
  );
7201
7209
  }
7202
7210
  } else if (exec === "prun") {
@@ -7207,7 +7215,7 @@ async function setup() {
7207
7215
  (0, import_lazy_js_utils14.jsShell)(`cargo build ${params}`);
7208
7216
  } else {
7209
7217
  console.log(
7210
- import_picocolors7.default.red(
7218
+ import_picocolors8.default.red(
7211
7219
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7212
7220
  )
7213
7221
  );
@@ -7216,7 +7224,7 @@ async function setup() {
7216
7224
  }
7217
7225
  if (!runMap[exec]) {
7218
7226
  console.log(
7219
- import_picocolors7.default.yellow(
7227
+ import_picocolors8.default.yellow(
7220
7228
  isZh5 ? "\u547D\u4EE4\u4E0D\u5B58\u5728\uFF0C\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9" : "The command does not exist, please execute pi -h to view the help"
7221
7229
  )
7222
7230
  );
package/dist/index.js CHANGED
@@ -5652,7 +5652,7 @@ var require_bl = __commonJS({
5652
5652
  });
5653
5653
 
5654
5654
  // src/index.ts
5655
- var import_picocolors7 = __toESM(require_picocolors(), 1);
5655
+ var import_picocolors8 = __toESM(require_picocolors(), 1);
5656
5656
  import process11 from "process";
5657
5657
  import {
5658
5658
  hasPkg,
@@ -6755,7 +6755,7 @@ function getLatestVersion(pkg, isZh6 = true) {
6755
6755
  import { jsShell as jsShell2 } from "lazy-js-utils";
6756
6756
 
6757
6757
  // package.json
6758
- var version = "0.0.82";
6758
+ var version = "0.0.83";
6759
6759
 
6760
6760
  // src/help.ts
6761
6761
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6810,17 +6810,25 @@ async function installDeps() {
6810
6810
  }
6811
6811
 
6812
6812
  // src/pi.ts
6813
- var import_picocolors3 = __toESM(require_picocolors(), 1);
6813
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
6814
6814
  import process9 from "process";
6815
6815
  import { getPkgTool as getPkgTool2, jsShell as jsShell5, useNodeWorker } from "lazy-js-utils";
6816
6816
 
6817
6817
  // src/detectNode.ts
6818
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
6818
6819
  import process8 from "process";
6819
6820
  import { getPkg as getPkg2, jsShell as jsShell4 } from "lazy-js-utils";
6820
6821
  var semver = __require("semver");
6821
6822
  async function detectNode() {
6822
6823
  var _a;
6823
- const pkg = await getPkg2();
6824
+ let pkg;
6825
+ try {
6826
+ pkg = await getPkg2();
6827
+ } catch (e) {
6828
+ const cwd = process8.cwd();
6829
+ console.log(import_picocolors3.default.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
6830
+ process8.exit(1);
6831
+ }
6824
6832
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6825
6833
  const isSafe = semver.satisfies(process8.version, pkg.engines.node);
6826
6834
  if (!isSafe) {
@@ -6832,13 +6840,13 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6832
6840
  if (status === 0 && result === "yes") {
6833
6841
  await jsShell4(
6834
6842
  `
6835
- current=$(echo $(fnm current))
6836
- registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6837
- registery=$(echo \${registery// /} | sed 's/*//g')
6838
- if [ $registery ]; then
6839
- fnm use \${registery% -*}
6840
- fi
6841
- `,
6843
+ current=$(echo $(fnm current))
6844
+ registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6845
+ registery=$(echo \${registery// /} | sed 's/*//g')
6846
+ if [ $registery ]; then
6847
+ fnm use \${registery% -*}
6848
+ fi
6849
+ `,
6842
6850
  "pipe"
6843
6851
  );
6844
6852
  }
@@ -6888,15 +6896,15 @@ async function pi(params, pkg, executor = "ni") {
6888
6896
  loading_status = await loading("");
6889
6897
  const end = Date.now();
6890
6898
  const costTime = (end - start) / 1e3;
6891
- successMsg += import_picocolors3.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6899
+ successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6892
6900
  if (status === 0) {
6893
- loading_status.succeed(import_picocolors3.default.green(successMsg));
6901
+ loading_status.succeed(import_picocolors4.default.green(successMsg));
6894
6902
  } else if (result && result.includes("Not Found - 404")) {
6895
6903
  const _result = isZh3 ? `${pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${pkg} the package name may be wrong, and cannot be found in npm, please check`;
6896
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6904
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6897
6905
  ${_result}` : failMsg));
6898
6906
  } else {
6899
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6907
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6900
6908
  ${result}` : failMsg));
6901
6909
  }
6902
6910
  if (result) {
@@ -6928,7 +6936,7 @@ function pfind(params) {
6928
6936
  }
6929
6937
 
6930
6938
  // src/pil.ts
6931
- var import_picocolors4 = __toESM(require_picocolors(), 1);
6939
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
6932
6940
  import { getPkg as getPkg3, jsShell as jsShell8 } from "lazy-js-utils";
6933
6941
  async function pil(params) {
6934
6942
  const { dependencies = {}, devDependencies = {} } = await getPkg3();
@@ -6946,7 +6954,7 @@ async function pil(params) {
6946
6954
  "pipe"
6947
6955
  );
6948
6956
  if (status === 130) {
6949
- console.log(import_picocolors4.default.dim("\u5DF2\u53D6\u6D88"));
6957
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
6950
6958
  process.exit(0);
6951
6959
  } else if (status !== 0) {
6952
6960
  throw new Error(choose);
@@ -7020,7 +7028,7 @@ function pu() {
7020
7028
  }
7021
7029
 
7022
7030
  // src/pui.ts
7023
- var import_picocolors5 = __toESM(require_picocolors(), 1);
7031
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
7024
7032
  import { getPkg as getPkg4, jsShell as jsShell12, useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7025
7033
  var isZh4 = process.env.PI_Lang === "zh";
7026
7034
  async function pui(params, pkg) {
@@ -7040,7 +7048,7 @@ async function pui(params, pkg) {
7040
7048
  "pipe"
7041
7049
  );
7042
7050
  if (status2 === 130) {
7043
- console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7051
+ console.log(import_picocolors6.default.dim("\u5DF2\u53D6\u6D88"));
7044
7052
  process.exit(0);
7045
7053
  } else if (status2 !== 0) {
7046
7054
  throw new Error(choose);
@@ -7052,7 +7060,7 @@ async function pui(params, pkg) {
7052
7060
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
7053
7061
  if (!pkg) {
7054
7062
  console.log(
7055
- import_picocolors5.default.yellow(
7063
+ import_picocolors6.default.yellow(
7056
7064
  isZh4 ? "\u9700\u8981\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u5305\u540D\uFF01" : "Need to specify an uninstall package name!"
7057
7065
  )
7058
7066
  );
@@ -7062,17 +7070,17 @@ async function pui(params, pkg) {
7062
7070
  const { status, result } = await useNodeWorker2(`nun ${params}`);
7063
7071
  const end = Date.now();
7064
7072
  const costTime = (end - start) / 1e3;
7065
- successMsg += import_picocolors5.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7073
+ successMsg += import_picocolors6.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7066
7074
  if (status === 0)
7067
- loading_status.succeed(import_picocolors5.default.green(successMsg));
7075
+ loading_status.succeed(import_picocolors6.default.green(successMsg));
7068
7076
  else
7069
- loading_status.fail(import_picocolors5.default.red(result ? `${failMsg}
7077
+ loading_status.fail(import_picocolors6.default.red(result ? `${failMsg}
7070
7078
  ${result}` : failMsg));
7071
7079
  process.exit();
7072
7080
  }
7073
7081
 
7074
7082
  // src/pio.ts
7075
- var import_picocolors6 = __toESM(require_picocolors(), 1);
7083
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
7076
7084
  import process10 from "process";
7077
7085
  import { useNodeWorker as useNodeWorker3 } from "lazy-js-utils";
7078
7086
  async function pio(params, pkg, executor = "ni") {
@@ -7086,9 +7094,9 @@ async function pio(params, pkg, executor = "ni") {
7086
7094
  });
7087
7095
  const loading_status = await loading("");
7088
7096
  if (status === 0)
7089
- loading_status.succeed(import_picocolors6.default.green(successMsg));
7097
+ loading_status.succeed(import_picocolors7.default.green(successMsg));
7090
7098
  else
7091
- loading_status.fail(import_picocolors6.default.red(result ? `${result}
7099
+ loading_status.fail(import_picocolors7.default.red(result ? `${result}
7092
7100
 
7093
7101
  ${failMsg}` : failMsg));
7094
7102
  process10.exit();
@@ -7133,11 +7141,11 @@ async function setup() {
7133
7141
  const { status } = params ? await useNodeWorker4(`go get ${params}`) : await useNodeWorker4("go mod tidy");
7134
7142
  if (status === 0) {
7135
7143
  loading_status.succeed(
7136
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7144
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7137
7145
  );
7138
7146
  } else {
7139
7147
  loading_status.fail(
7140
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7148
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7141
7149
  );
7142
7150
  }
7143
7151
  } else if (exec === "pui") {
@@ -7148,11 +7156,11 @@ async function setup() {
7148
7156
  const { status } = await useNodeWorker4(`go clean ${params}`);
7149
7157
  if (status === 0) {
7150
7158
  loading_status.succeed(
7151
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7159
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7152
7160
  );
7153
7161
  } else {
7154
7162
  loading_status.fail(
7155
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7163
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7156
7164
  );
7157
7165
  }
7158
7166
  } else if (exec === "prun") {
@@ -7165,7 +7173,7 @@ async function setup() {
7165
7173
  jsShell13(`go build ${params}`);
7166
7174
  } else {
7167
7175
  console.log(
7168
- import_picocolors7.default.red(
7176
+ import_picocolors8.default.red(
7169
7177
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7170
7178
  )
7171
7179
  );
@@ -7181,11 +7189,11 @@ async function setup() {
7181
7189
  const { status } = await useNodeWorker4(`cargo install ${params}`);
7182
7190
  if (status === 0) {
7183
7191
  loading_status.succeed(
7184
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7192
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7185
7193
  );
7186
7194
  } else {
7187
7195
  loading_status.fail(
7188
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7196
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7189
7197
  );
7190
7198
  }
7191
7199
  } else if (exec === "pui") {
@@ -7196,11 +7204,11 @@ async function setup() {
7196
7204
  const { status } = await useNodeWorker4(`cargo uninstall ${params}`);
7197
7205
  if (status === 0) {
7198
7206
  loading_status.succeed(
7199
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7207
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7200
7208
  );
7201
7209
  } else {
7202
7210
  loading_status.fail(
7203
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7211
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7204
7212
  );
7205
7213
  }
7206
7214
  } else if (exec === "prun") {
@@ -7211,7 +7219,7 @@ async function setup() {
7211
7219
  jsShell13(`cargo build ${params}`);
7212
7220
  } else {
7213
7221
  console.log(
7214
- import_picocolors7.default.red(
7222
+ import_picocolors8.default.red(
7215
7223
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7216
7224
  )
7217
7225
  );
@@ -7220,7 +7228,7 @@ async function setup() {
7220
7228
  }
7221
7229
  if (!runMap[exec]) {
7222
7230
  console.log(
7223
- import_picocolors7.default.yellow(
7231
+ import_picocolors8.default.yellow(
7224
7232
  isZh5 ? "\u547D\u4EE4\u4E0D\u5B58\u5728\uFF0C\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9" : "The command does not exist, please execute pi -h to view the help"
7225
7233
  )
7226
7234
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.82",
4
+ "version": "0.0.83",
5
5
  "description": "",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",