botapp-cli 0.2.3 → 0.2.4
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/bin/bot.js +17 -10
- package/dist/bin/bot.js.map +1 -1
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/bot.js
CHANGED
|
@@ -1592,7 +1592,7 @@ Invalid ACP stdout: ${line}`;
|
|
|
1592
1592
|
clientInfo: {
|
|
1593
1593
|
name: "botapp-daemon",
|
|
1594
1594
|
title: "botapp daemon",
|
|
1595
|
-
version: "0.2.
|
|
1595
|
+
version: "0.2.4"
|
|
1596
1596
|
}
|
|
1597
1597
|
});
|
|
1598
1598
|
const session = await request2("session/new", {
|
|
@@ -3264,6 +3264,7 @@ async function obtainPairingToken(opts) {
|
|
|
3264
3264
|
|
|
3265
3265
|
// src/commands/update.ts
|
|
3266
3266
|
import { spawn as spawn6 } from "child_process";
|
|
3267
|
+
import { realpathSync } from "fs";
|
|
3267
3268
|
import { Command as Command19 } from "commander";
|
|
3268
3269
|
import pc20 from "picocolors";
|
|
3269
3270
|
var PACKAGE_NAME = "botapp-cli";
|
|
@@ -3318,16 +3319,22 @@ var updateCommand = new Command19("update").description("Update the `bot` CLI it
|
|
|
3318
3319
|
console.log(pc20.green("botapp-cli updated. Run `bot --version` to confirm."));
|
|
3319
3320
|
});
|
|
3320
3321
|
function detectPackageManager() {
|
|
3321
|
-
const
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3322
|
+
const argv = process.argv[1] ?? "";
|
|
3323
|
+
let real = "";
|
|
3324
|
+
try {
|
|
3325
|
+
real = argv ? realpathSync(argv) : "";
|
|
3326
|
+
} catch {
|
|
3327
|
+
}
|
|
3328
|
+
const candidates = [argv, real].filter(Boolean);
|
|
3329
|
+
if (matchAny(candidates, ["/_npx/", "\\_npx\\"])) return "npx";
|
|
3330
|
+
if (matchAny(candidates, ["/pnpm/", "\\pnpm\\", "/.pnpm/"])) return "pnpm";
|
|
3331
|
+
if (matchAny(candidates, ["/.yarn/", "/yarn/global/"])) return "yarn";
|
|
3332
|
+
if (matchAny(candidates, ["/Cellar/", "/homebrew/", "\\Cellar\\"])) return "brew";
|
|
3333
|
+
if (matchAny(candidates, ["/lib/node_modules/", "\\node_modules\\"]) || candidates.some((c) => c.includes("npm"))) return "npm";
|
|
3327
3334
|
return null;
|
|
3328
3335
|
}
|
|
3329
|
-
function matchAny(
|
|
3330
|
-
return needles.some((n) =>
|
|
3336
|
+
function matchAny(haystacks, needles) {
|
|
3337
|
+
return haystacks.some((h) => needles.some((n) => h.includes(n)));
|
|
3331
3338
|
}
|
|
3332
3339
|
function updateCommandFor(manager) {
|
|
3333
3340
|
switch (manager) {
|
|
@@ -3344,7 +3351,7 @@ function updateCommandFor(manager) {
|
|
|
3344
3351
|
}
|
|
3345
3352
|
|
|
3346
3353
|
// src/index.ts
|
|
3347
|
-
var version = "0.2.
|
|
3354
|
+
var version = "0.2.4";
|
|
3348
3355
|
var program = new Command20().name("bot").description("botapp CLI \u2014 operate apps from the command line").version(version).enablePositionalOptions(true).option("--json", "Output as JSON").option("-s, --server <url>", "Server URL override").option("-t, --token <token>", "Auth token override").option("-v, --verbose", "Verbose output");
|
|
3349
3356
|
program.addCommand(launchCommand);
|
|
3350
3357
|
program.addCommand(runCommand);
|