adhdev 0.1.18 → 0.1.19
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.js +26 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -874,13 +874,14 @@ async function installCliOnly() {
|
|
|
874
874
|
try {
|
|
875
875
|
const result = execSyncLocal("npm list -g adhdev --json 2>/dev/null || npm list -g adhdev --json 2>nul", {
|
|
876
876
|
encoding: "utf-8",
|
|
877
|
-
timeout:
|
|
877
|
+
timeout: 5e3,
|
|
878
878
|
stdio: ["pipe", "pipe", "pipe"]
|
|
879
879
|
});
|
|
880
880
|
const parsed = JSON.parse(result);
|
|
881
881
|
currentVersion = parsed.dependencies?.adhdev?.version || null;
|
|
882
882
|
} catch {
|
|
883
883
|
}
|
|
884
|
+
const isNpx = process.env.npm_execpath?.includes("npx") || process.argv[1]?.includes("npx") || process.argv[1]?.includes("_npx");
|
|
884
885
|
console.log(import_chalk.default.bold("\n\u{1F527} ADHDev CLI\n"));
|
|
885
886
|
console.log(import_chalk.default.gray(" The `adhdev` command lets you:"));
|
|
886
887
|
console.log(import_chalk.default.gray(" \u2022 Launch IDE with CDP debugging (adhdev launch cursor)"));
|
|
@@ -889,24 +890,32 @@ async function installCliOnly() {
|
|
|
889
890
|
console.log();
|
|
890
891
|
if (currentVersion) {
|
|
891
892
|
console.log(import_chalk.default.green(` \u2713 Currently installed: v${currentVersion}`));
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
893
|
+
if (!isNpx) {
|
|
894
|
+
const { doUpdate } = await import_inquirer.default.prompt([{
|
|
895
|
+
type: "confirm",
|
|
896
|
+
name: "doUpdate",
|
|
897
|
+
message: "Update to latest version?",
|
|
898
|
+
default: true
|
|
899
|
+
}]);
|
|
900
|
+
if (!doUpdate) return;
|
|
901
|
+
} else {
|
|
902
|
+
console.log(import_chalk.default.gray(" Updating to latest..."));
|
|
903
|
+
}
|
|
899
904
|
} else {
|
|
900
905
|
console.log(import_chalk.default.yellow(" \u2717 Not installed globally"));
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
906
|
+
if (!isNpx) {
|
|
907
|
+
const { doInstall } = await import_inquirer.default.prompt([{
|
|
908
|
+
type: "confirm",
|
|
909
|
+
name: "doInstall",
|
|
910
|
+
message: "Install adhdev CLI globally? (npm install -g adhdev)",
|
|
911
|
+
default: true
|
|
912
|
+
}]);
|
|
913
|
+
if (!doInstall) {
|
|
914
|
+
console.log(import_chalk.default.gray("\n You can install later: npm install -g adhdev\n"));
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
} else {
|
|
918
|
+
console.log(import_chalk.default.gray(" Installing globally..."));
|
|
910
919
|
}
|
|
911
920
|
}
|
|
912
921
|
const installSpinner = (0, import_ora.default)("Installing adhdev CLI...").start();
|