alive-ai 0.1.4 → 0.1.5
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/cli/index.js +11 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/cli/index.js
CHANGED
|
@@ -471,10 +471,18 @@ async function setupProject(args) {
|
|
|
471
471
|
console.log("Run `npx . chat` for terminal chat, `npx . demo` for the dashboard preview, or `npx . start` for Telegram/runtime mode.");
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
+
function commandResponds(command, versionArgSets = [["--version"], ["-version"]]) {
|
|
475
|
+
for (const args of versionArgSets) {
|
|
476
|
+
const result = spawnSync(command, args, { stdio: "ignore" });
|
|
477
|
+
if (result.status === 0) return true;
|
|
478
|
+
if (result.error && result.error.code === "ENOENT") return false;
|
|
479
|
+
}
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
|
|
474
483
|
function findCommand(candidates) {
|
|
475
484
|
for (const command of candidates) {
|
|
476
|
-
|
|
477
|
-
if (result.status === 0) return command;
|
|
485
|
+
if (commandResponds(command)) return command;
|
|
478
486
|
}
|
|
479
487
|
return null;
|
|
480
488
|
}
|
|
@@ -492,7 +500,7 @@ function pythonVersion(command) {
|
|
|
492
500
|
}
|
|
493
501
|
|
|
494
502
|
function hasCommand(command) {
|
|
495
|
-
return
|
|
503
|
+
return commandResponds(command);
|
|
496
504
|
}
|
|
497
505
|
|
|
498
506
|
function commandLine(command) {
|
package/package.json
CHANGED