@simon_he/pi 0.1.25 → 0.2.0
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 +18 -3
- package/dist/index.mjs +18 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -44,7 +44,7 @@ let node_module = require("node:module");
|
|
|
44
44
|
let node_url = require("node:url");
|
|
45
45
|
|
|
46
46
|
//#region package.json
|
|
47
|
-
var version = "0.
|
|
47
|
+
var version = "0.2.0";
|
|
48
48
|
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/installDeps.ts
|
|
@@ -498,9 +498,24 @@ function getCcommand() {
|
|
|
498
498
|
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region src/pfind.ts
|
|
501
|
-
function
|
|
501
|
+
function isNoHistory$1(value) {
|
|
502
|
+
if (!value) return false;
|
|
503
|
+
const normalized = value.toLowerCase();
|
|
504
|
+
return normalized === "1" || normalized === "true" || normalized === "yes";
|
|
505
|
+
}
|
|
506
|
+
async function pfind(params) {
|
|
507
|
+
const hadNoHistoryEnv = node_process.default.env.CCOMMAND_NO_HISTORY != null || node_process.default.env.NO_HISTORY != null;
|
|
508
|
+
const initialNoHistory = node_process.default.env.CCOMMAND_NO_HISTORY ?? node_process.default.env.NO_HISTORY;
|
|
509
|
+
const shouldWriteHistory = !(hadNoHistoryEnv && isNoHistory$1(initialNoHistory));
|
|
502
510
|
const { ccommand } = getCcommand();
|
|
503
|
-
|
|
511
|
+
const prevNoHistory = node_process.default.env.CCOMMAND_NO_HISTORY;
|
|
512
|
+
if (shouldWriteHistory) delete node_process.default.env.CCOMMAND_NO_HISTORY;
|
|
513
|
+
try {
|
|
514
|
+
await ccommand(`find ${params}`);
|
|
515
|
+
} finally {
|
|
516
|
+
if (prevNoHistory == null) delete node_process.default.env.CCOMMAND_NO_HISTORY;
|
|
517
|
+
else node_process.default.env.CCOMMAND_NO_HISTORY = prevNoHistory;
|
|
518
|
+
}
|
|
504
519
|
}
|
|
505
520
|
|
|
506
521
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import os from "node:os";
|
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "0.
|
|
14
|
+
var version = "0.2.0";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/installDeps.ts
|
|
@@ -465,9 +465,24 @@ function getCcommand() {
|
|
|
465
465
|
|
|
466
466
|
//#endregion
|
|
467
467
|
//#region src/pfind.ts
|
|
468
|
-
function
|
|
468
|
+
function isNoHistory$1(value) {
|
|
469
|
+
if (!value) return false;
|
|
470
|
+
const normalized = value.toLowerCase();
|
|
471
|
+
return normalized === "1" || normalized === "true" || normalized === "yes";
|
|
472
|
+
}
|
|
473
|
+
async function pfind(params) {
|
|
474
|
+
const hadNoHistoryEnv = process.env.CCOMMAND_NO_HISTORY != null || process.env.NO_HISTORY != null;
|
|
475
|
+
const initialNoHistory = process.env.CCOMMAND_NO_HISTORY ?? process.env.NO_HISTORY;
|
|
476
|
+
const shouldWriteHistory = !(hadNoHistoryEnv && isNoHistory$1(initialNoHistory));
|
|
469
477
|
const { ccommand } = getCcommand();
|
|
470
|
-
|
|
478
|
+
const prevNoHistory = process.env.CCOMMAND_NO_HISTORY;
|
|
479
|
+
if (shouldWriteHistory) delete process.env.CCOMMAND_NO_HISTORY;
|
|
480
|
+
try {
|
|
481
|
+
await ccommand(`find ${params}`);
|
|
482
|
+
} finally {
|
|
483
|
+
if (prevNoHistory == null) delete process.env.CCOMMAND_NO_HISTORY;
|
|
484
|
+
else process.env.CCOMMAND_NO_HISTORY = prevNoHistory;
|
|
485
|
+
}
|
|
471
486
|
}
|
|
472
487
|
|
|
473
488
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simon_he/pi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"packageManager": "pnpm@10.28.2",
|
|
6
6
|
"description": "An intelligent cross-platform package manager and CLI tool that autodetects project environments (Node.mjs, Go, Rust, Python) with beautiful loading animations and smart command execution.",
|
|
7
7
|
"author": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"test": "vitest"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"ccommand": "^1.
|
|
93
|
+
"ccommand": "^1.1.1",
|
|
94
94
|
"fast-glob": "^3.3.3",
|
|
95
95
|
"lazy-js-utils": "^0.1.49",
|
|
96
96
|
"ora": "^8.2.0",
|