@simon_he/pi 0.0.54 → 0.0.55

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
@@ -40,6 +40,18 @@ A smart package manager with a custom loading style, which makes you install dep
40
40
  - others
41
41
  ![gif](/assets/others.gif)
42
42
 
43
+ ## :phone: Language
44
+
45
+ ```
46
+ # Export environment variables in your bash or zsh
47
+
48
+ # Chinese
49
+ export PI_Lang=zh
50
+
51
+ # English
52
+ export PI_Lang=en
53
+ ```
54
+
43
55
  ## :gear: Install
44
56
 
45
57
  ```
package/dist/index.cjs CHANGED
@@ -6362,6 +6362,7 @@ var Dw = /\s-Dw/;
6362
6362
  var w = /\s-w/;
6363
6363
  var D = /\s-D(?!w)/;
6364
6364
  var d = /\s-d(?!w)/;
6365
+ var isZh = process.env.PI_Lang === "zh";
6365
6366
  async function getParams(params) {
6366
6367
  var _a, _b;
6367
6368
  const root = process.cwd();
@@ -6422,7 +6423,9 @@ async function getParams(params) {
6422
6423
  }
6423
6424
  } catch (err) {
6424
6425
  console.log(
6425
- import_picocolors.default.red(`package.json has not been found in ${process.cwd()}`)
6426
+ import_picocolors.default.red(
6427
+ `${isZh ? "package.json\u5E76\u4E0D\u5B58\u5728,\u5728\u4EE5\u4E0B\u76EE\u5F55\u4E2D:" : "package.json has not been found in"} ${process.cwd()}`
6428
+ )
6426
6429
  );
6427
6430
  process.exit(1);
6428
6431
  }
@@ -6448,13 +6451,16 @@ async function getStyle() {
6448
6451
  var import_lazy_js_utils2 = require("lazy-js-utils");
6449
6452
 
6450
6453
  // package.json
6451
- var version = "0.0.54";
6454
+ var version = "0.0.55";
6452
6455
 
6453
6456
  // src/help.ts
6457
+ var isZh2 = process.env.PI_Lang === "zh";
6454
6458
  function help(argv) {
6455
6459
  const arg = argv[0];
6456
6460
  if (arg === "-v" || arg === "--version") {
6457
- (0, import_lazy_js_utils2.jsShell)(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi version: ${version}" "Please give me a \u{1F31F} for my efforts" "Thank you \u{1F91F}"`);
6461
+ (0, import_lazy_js_utils2.jsShell)(
6462
+ isZh2 ? `gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi \u7248\u672C: ${version}" "\u8BF7\u4E3A\u6211\u7684\u52AA\u529B\u70B9\u4E00\u4E2A\u884C \u{1F31F}" "\u8C22\u8C22 \u{1F91F}"` : `gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi version: ${version}" "Please give me a \u{1F31F} for my efforts" "Thank you \u{1F91F}"`
6463
+ );
6458
6464
  process.exit(0);
6459
6465
  } else if (arg === "-h" || arg === "--help") {
6460
6466
  (0, import_lazy_js_utils2.jsShell)(
@@ -6483,10 +6489,11 @@ async function installDeps() {
6483
6489
  var import_process = __toESM(require("process"), 1);
6484
6490
  var import_lazy_js_utils4 = require("lazy-js-utils");
6485
6491
  var import_picocolors2 = __toESM(require_picocolors(), 1);
6492
+ var isZh3 = import_process.default.env.PI_Lang === "zh";
6486
6493
  async function pi(params, pkg, executor = "ni") {
6487
6494
  const text = pkg ? `Installing ${pkg} ...` : "Updating dependency ...";
6488
- const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
6489
- const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
6495
+ const successMsg = pkg ? isZh3 ? `${pkg}\u5B89\u88C5\u6210\u529F! \u{1F60A}` : `Installed ${pkg} successfully! \u{1F60A}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u6210\u529F! \u{1F60A}" : "Updated dependency successfully! \u{1F60A}";
6496
+ const failMsg = pkg ? isZh3 ? `${pkg}\u5B89\u88C5\u5931\u8D25 \u{1F62D}` : `Failed to install ${pkg} \u{1F62D}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u5931\u8D25 \u{1F62D}" : "Failed to update dependency \u{1F62D}";
6490
6497
  const newParams = executor === "pil" ? params : await getParams(params);
6491
6498
  let stdio = "pipe";
6492
6499
  let loading_status;
@@ -6591,7 +6598,7 @@ async function pinit() {
6591
6598
  // src/pix.ts
6592
6599
  var import_lazy_js_utils8 = require("lazy-js-utils");
6593
6600
  async function pix(params) {
6594
- switch ((0, import_lazy_js_utils8.getPkgTool)()) {
6601
+ switch (await (0, import_lazy_js_utils8.getPkgTool)()) {
6595
6602
  case "bun":
6596
6603
  return (0, import_lazy_js_utils8.jsShell)(`bunx ${params}`);
6597
6604
  default:
@@ -6614,13 +6621,11 @@ function pu() {
6614
6621
  // src/pui.ts
6615
6622
  var import_lazy_js_utils11 = require("lazy-js-utils");
6616
6623
  var import_picocolors3 = __toESM(require_picocolors(), 1);
6624
+ var isZh4 = process.env.PI_Lang === "zh";
6617
6625
  async function pui(params, pkg) {
6618
- const text = `Uninstalling ${pkg} ...
6619
- `;
6620
- const successMsg = `
6621
- UnInstalled ${pkg} successfully! \u{1F60A}`;
6622
- const failMsg = `
6623
- Failed to uninstall ${pkg} \u{1F62D}`;
6626
+ const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
6627
+ const successMsg = isZh4 ? `${pkg}\u5378\u8F7D\u6210\u529F! \u{1F60A}` : `UnInstalled ${pkg} successfully! \u{1F60A}`;
6628
+ const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
6624
6629
  if (!pkg) {
6625
6630
  console.log("Need to specify an uninstall package name");
6626
6631
  process.exit(1);
@@ -6672,6 +6677,7 @@ var runMap = {
6672
6677
  pfind,
6673
6678
  pio
6674
6679
  };
6680
+ var isZh5 = import_process3.default.env.PI_Lang === "zh";
6675
6681
  async function setup() {
6676
6682
  const cmd = import_process3.default.argv[1];
6677
6683
  let exec = "";
@@ -6688,21 +6694,35 @@ async function setup() {
6688
6694
  if (!(0, import_lazy_js_utils13.hasPkg)(rootPath)) {
6689
6695
  if ((0, import_lazy_js_utils13.isGo)()) {
6690
6696
  if (exec === "pi") {
6691
- const loading_status = await loading(`Installing ${params} ...
6692
- `);
6697
+ const loading_status = await loading(
6698
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
6699
+ `
6700
+ );
6693
6701
  const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`go get ${params}`);
6694
- if (status === 0)
6695
- loading_status.succeed(import_picocolors5.default.green("Installed successfully! \u{1F60A}"));
6696
- else
6697
- loading_status.fail(import_picocolors5.default.red("Failed to install \u{1F62D}"));
6702
+ if (status === 0) {
6703
+ loading_status.succeed(
6704
+ import_picocolors5.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
6705
+ );
6706
+ } else {
6707
+ loading_status.fail(
6708
+ import_picocolors5.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
6709
+ );
6710
+ }
6698
6711
  } else if (exec === "pui") {
6699
- const loading_status = await loading(`Uninstalling ${params} ...
6700
- `);
6712
+ const loading_status = await loading(
6713
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
6714
+ `
6715
+ );
6701
6716
  const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`go clean ${params}`);
6702
- if (status === 0)
6703
- loading_status.succeed(import_picocolors5.default.green("Uninstalled successfully! \u{1F60A}"));
6704
- else
6705
- loading_status.fail(import_picocolors5.default.red("Failed to uninstall \u{1F62D}"));
6717
+ if (status === 0) {
6718
+ loading_status.succeed(
6719
+ import_picocolors5.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
6720
+ );
6721
+ } else {
6722
+ loading_status.fail(
6723
+ import_picocolors5.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
6724
+ );
6725
+ }
6706
6726
  } else if (exec === "prun") {
6707
6727
  const match = params ? params.endsWith(".go") ? [`**/${params}`] : [`**/${params}.go`, `**/${params}/main.go`] : "main.go";
6708
6728
  const target = (await (0, import_fast_glob.default)(match))[0];
@@ -6716,27 +6736,45 @@ async function setup() {
6716
6736
  } else if (exec === "pbuild") {
6717
6737
  (0, import_lazy_js_utils13.jsShell)(`go build ${params}`);
6718
6738
  } else {
6719
- console.log(import_picocolors5.default.red("The commands is not supported"));
6739
+ console.log(
6740
+ import_picocolors5.default.red(
6741
+ isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
6742
+ )
6743
+ );
6720
6744
  }
6721
6745
  import_process3.default.exit();
6722
6746
  }
6723
6747
  if ((0, import_lazy_js_utils13.isRust)()) {
6724
6748
  if (exec === "pi") {
6725
- const loading_status = await loading(`Installing ${params} ...
6726
- `);
6749
+ const loading_status = await loading(
6750
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
6751
+ `
6752
+ );
6727
6753
  const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo install ${params}`);
6728
- if (status === 0)
6729
- loading_status.succeed(import_picocolors5.default.green("Installed successfully! \u{1F60A}"));
6730
- else
6731
- loading_status.fail(import_picocolors5.default.red("Failed to install \u{1F62D}"));
6754
+ if (status === 0) {
6755
+ loading_status.succeed(
6756
+ import_picocolors5.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
6757
+ );
6758
+ } else {
6759
+ loading_status.fail(
6760
+ import_picocolors5.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
6761
+ );
6762
+ }
6732
6763
  } else if (exec === "pui") {
6733
- const loading_status = await loading(`Uninstalling ${params} ...
6734
- `);
6764
+ const loading_status = await loading(
6765
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
6766
+ `
6767
+ );
6735
6768
  const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo uninstall ${params}`);
6736
- if (status === 0)
6737
- loading_status.succeed(import_picocolors5.default.green("Uninstalled successfully! \u{1F60A}"));
6738
- else
6739
- loading_status.fail(import_picocolors5.default.red("Failed to uninstall \u{1F62D}"));
6769
+ if (status === 0) {
6770
+ loading_status.succeed(
6771
+ import_picocolors5.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
6772
+ );
6773
+ } else {
6774
+ loading_status.fail(
6775
+ import_picocolors5.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
6776
+ );
6777
+ }
6740
6778
  } else if (exec === "prun") {
6741
6779
  (0, import_lazy_js_utils13.jsShell)(`cargo run ${params}`);
6742
6780
  } else if (exec === "pinit") {
@@ -6744,14 +6782,18 @@ async function setup() {
6744
6782
  } else if (exec === "pbuild") {
6745
6783
  (0, import_lazy_js_utils13.jsShell)(`cargo build ${params}`);
6746
6784
  } else {
6747
- console.log(import_picocolors5.default.red("The commands is not supported"));
6785
+ console.log(
6786
+ import_picocolors5.default.red(
6787
+ isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
6788
+ )
6789
+ );
6748
6790
  }
6749
6791
  import_process3.default.exit();
6750
6792
  }
6751
6793
  if (!runMap[exec]) {
6752
6794
  console.log(
6753
6795
  import_picocolors5.default.yellow(
6754
- "The command does not exist, please execute pi -h to view the help"
6796
+ 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"
6755
6797
  )
6756
6798
  );
6757
6799
  return;
package/dist/index.js CHANGED
@@ -6366,6 +6366,7 @@ var Dw = /\s-Dw/;
6366
6366
  var w = /\s-w/;
6367
6367
  var D = /\s-D(?!w)/;
6368
6368
  var d = /\s-d(?!w)/;
6369
+ var isZh = process.env.PI_Lang === "zh";
6369
6370
  async function getParams(params) {
6370
6371
  var _a, _b;
6371
6372
  const root = process.cwd();
@@ -6426,7 +6427,9 @@ async function getParams(params) {
6426
6427
  }
6427
6428
  } catch (err) {
6428
6429
  console.log(
6429
- import_picocolors.default.red(`package.json has not been found in ${process.cwd()}`)
6430
+ import_picocolors.default.red(
6431
+ `${isZh ? "package.json\u5E76\u4E0D\u5B58\u5728,\u5728\u4EE5\u4E0B\u76EE\u5F55\u4E2D:" : "package.json has not been found in"} ${process.cwd()}`
6432
+ )
6430
6433
  );
6431
6434
  process.exit(1);
6432
6435
  }
@@ -6452,13 +6455,16 @@ async function getStyle() {
6452
6455
  import { jsShell } from "lazy-js-utils";
6453
6456
 
6454
6457
  // package.json
6455
- var version = "0.0.54";
6458
+ var version = "0.0.55";
6456
6459
 
6457
6460
  // src/help.ts
6461
+ var isZh2 = process.env.PI_Lang === "zh";
6458
6462
  function help(argv) {
6459
6463
  const arg = argv[0];
6460
6464
  if (arg === "-v" || arg === "--version") {
6461
- jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi version: ${version}" "Please give me a \u{1F31F} for my efforts" "Thank you \u{1F91F}"`);
6465
+ jsShell(
6466
+ isZh2 ? `gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi \u7248\u672C: ${version}" "\u8BF7\u4E3A\u6211\u7684\u52AA\u529B\u70B9\u4E00\u4E2A\u884C \u{1F31F}" "\u8C22\u8C22 \u{1F91F}"` : `gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" "pi version: ${version}" "Please give me a \u{1F31F} for my efforts" "Thank you \u{1F91F}"`
6467
+ );
6462
6468
  process.exit(0);
6463
6469
  } else if (arg === "-h" || arg === "--help") {
6464
6470
  jsShell(
@@ -6487,10 +6493,11 @@ async function installDeps() {
6487
6493
  var import_picocolors2 = __toESM(require_picocolors(), 1);
6488
6494
  import process8 from "process";
6489
6495
  import { getPkgTool as getPkgTool2, jsShell as jsShell3, useNodeWorker } from "lazy-js-utils";
6496
+ var isZh3 = process8.env.PI_Lang === "zh";
6490
6497
  async function pi(params, pkg, executor = "ni") {
6491
6498
  const text = pkg ? `Installing ${pkg} ...` : "Updating dependency ...";
6492
- const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
6493
- const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
6499
+ const successMsg = pkg ? isZh3 ? `${pkg}\u5B89\u88C5\u6210\u529F! \u{1F60A}` : `Installed ${pkg} successfully! \u{1F60A}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u6210\u529F! \u{1F60A}" : "Updated dependency successfully! \u{1F60A}";
6500
+ const failMsg = pkg ? isZh3 ? `${pkg}\u5B89\u88C5\u5931\u8D25 \u{1F62D}` : `Failed to install ${pkg} \u{1F62D}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u5931\u8D25 \u{1F62D}" : "Failed to update dependency \u{1F62D}";
6494
6501
  const newParams = executor === "pil" ? params : await getParams(params);
6495
6502
  let stdio = "pipe";
6496
6503
  let loading_status;
@@ -6595,7 +6602,7 @@ async function pinit() {
6595
6602
  // src/pix.ts
6596
6603
  import { getPkgTool as getPkgTool4, jsShell as jsShell7 } from "lazy-js-utils";
6597
6604
  async function pix(params) {
6598
- switch (getPkgTool4()) {
6605
+ switch (await getPkgTool4()) {
6599
6606
  case "bun":
6600
6607
  return jsShell7(`bunx ${params}`);
6601
6608
  default:
@@ -6618,13 +6625,11 @@ function pu() {
6618
6625
  // src/pui.ts
6619
6626
  var import_picocolors3 = __toESM(require_picocolors(), 1);
6620
6627
  import { useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
6628
+ var isZh4 = process.env.PI_Lang === "zh";
6621
6629
  async function pui(params, pkg) {
6622
- const text = `Uninstalling ${pkg} ...
6623
- `;
6624
- const successMsg = `
6625
- UnInstalled ${pkg} successfully! \u{1F60A}`;
6626
- const failMsg = `
6627
- Failed to uninstall ${pkg} \u{1F62D}`;
6630
+ const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
6631
+ const successMsg = isZh4 ? `${pkg}\u5378\u8F7D\u6210\u529F! \u{1F60A}` : `UnInstalled ${pkg} successfully! \u{1F60A}`;
6632
+ const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
6628
6633
  if (!pkg) {
6629
6634
  console.log("Need to specify an uninstall package name");
6630
6635
  process.exit(1);
@@ -6676,6 +6681,7 @@ var runMap = {
6676
6681
  pfind,
6677
6682
  pio
6678
6683
  };
6684
+ var isZh5 = process10.env.PI_Lang === "zh";
6679
6685
  async function setup() {
6680
6686
  const cmd = process10.argv[1];
6681
6687
  let exec = "";
@@ -6692,21 +6698,35 @@ async function setup() {
6692
6698
  if (!hasPkg(rootPath)) {
6693
6699
  if (isGo()) {
6694
6700
  if (exec === "pi") {
6695
- const loading_status = await loading(`Installing ${params} ...
6696
- `);
6701
+ const loading_status = await loading(
6702
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
6703
+ `
6704
+ );
6697
6705
  const { status } = await useNodeWorker4(`go get ${params}`);
6698
- if (status === 0)
6699
- loading_status.succeed(import_picocolors5.default.green("Installed successfully! \u{1F60A}"));
6700
- else
6701
- loading_status.fail(import_picocolors5.default.red("Failed to install \u{1F62D}"));
6706
+ if (status === 0) {
6707
+ loading_status.succeed(
6708
+ import_picocolors5.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
6709
+ );
6710
+ } else {
6711
+ loading_status.fail(
6712
+ import_picocolors5.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
6713
+ );
6714
+ }
6702
6715
  } else if (exec === "pui") {
6703
- const loading_status = await loading(`Uninstalling ${params} ...
6704
- `);
6716
+ const loading_status = await loading(
6717
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
6718
+ `
6719
+ );
6705
6720
  const { status } = await useNodeWorker4(`go clean ${params}`);
6706
- if (status === 0)
6707
- loading_status.succeed(import_picocolors5.default.green("Uninstalled successfully! \u{1F60A}"));
6708
- else
6709
- loading_status.fail(import_picocolors5.default.red("Failed to uninstall \u{1F62D}"));
6721
+ if (status === 0) {
6722
+ loading_status.succeed(
6723
+ import_picocolors5.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
6724
+ );
6725
+ } else {
6726
+ loading_status.fail(
6727
+ import_picocolors5.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
6728
+ );
6729
+ }
6710
6730
  } else if (exec === "prun") {
6711
6731
  const match = params ? params.endsWith(".go") ? [`**/${params}`] : [`**/${params}.go`, `**/${params}/main.go`] : "main.go";
6712
6732
  const target = (await fg(match))[0];
@@ -6720,27 +6740,45 @@ async function setup() {
6720
6740
  } else if (exec === "pbuild") {
6721
6741
  jsShell10(`go build ${params}`);
6722
6742
  } else {
6723
- console.log(import_picocolors5.default.red("The commands is not supported"));
6743
+ console.log(
6744
+ import_picocolors5.default.red(
6745
+ isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
6746
+ )
6747
+ );
6724
6748
  }
6725
6749
  process10.exit();
6726
6750
  }
6727
6751
  if (isRust()) {
6728
6752
  if (exec === "pi") {
6729
- const loading_status = await loading(`Installing ${params} ...
6730
- `);
6753
+ const loading_status = await loading(
6754
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
6755
+ `
6756
+ );
6731
6757
  const { status } = await useNodeWorker4(`cargo install ${params}`);
6732
- if (status === 0)
6733
- loading_status.succeed(import_picocolors5.default.green("Installed successfully! \u{1F60A}"));
6734
- else
6735
- loading_status.fail(import_picocolors5.default.red("Failed to install \u{1F62D}"));
6758
+ if (status === 0) {
6759
+ loading_status.succeed(
6760
+ import_picocolors5.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
6761
+ );
6762
+ } else {
6763
+ loading_status.fail(
6764
+ import_picocolors5.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
6765
+ );
6766
+ }
6736
6767
  } else if (exec === "pui") {
6737
- const loading_status = await loading(`Uninstalling ${params} ...
6738
- `);
6768
+ const loading_status = await loading(
6769
+ `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
6770
+ `
6771
+ );
6739
6772
  const { status } = await useNodeWorker4(`cargo uninstall ${params}`);
6740
- if (status === 0)
6741
- loading_status.succeed(import_picocolors5.default.green("Uninstalled successfully! \u{1F60A}"));
6742
- else
6743
- loading_status.fail(import_picocolors5.default.red("Failed to uninstall \u{1F62D}"));
6773
+ if (status === 0) {
6774
+ loading_status.succeed(
6775
+ import_picocolors5.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
6776
+ );
6777
+ } else {
6778
+ loading_status.fail(
6779
+ import_picocolors5.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
6780
+ );
6781
+ }
6744
6782
  } else if (exec === "prun") {
6745
6783
  jsShell10(`cargo run ${params}`);
6746
6784
  } else if (exec === "pinit") {
@@ -6748,14 +6786,18 @@ async function setup() {
6748
6786
  } else if (exec === "pbuild") {
6749
6787
  jsShell10(`cargo build ${params}`);
6750
6788
  } else {
6751
- console.log(import_picocolors5.default.red("The commands is not supported"));
6789
+ console.log(
6790
+ import_picocolors5.default.red(
6791
+ isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
6792
+ )
6793
+ );
6752
6794
  }
6753
6795
  process10.exit();
6754
6796
  }
6755
6797
  if (!runMap[exec]) {
6756
6798
  console.log(
6757
6799
  import_picocolors5.default.yellow(
6758
- "The command does not exist, please execute pi -h to view the help"
6800
+ 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"
6759
6801
  )
6760
6802
  );
6761
6803
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.54",
4
+ "version": "0.0.55",
5
5
  "packageManager": "pnpm@7.26.1",
6
6
  "description": "",
7
7
  "author": "Simon He",