@kaynooo/cli-doctor 0.5.0 → 0.5.2
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/cli-bin.js +5 -5
- package/dist/cli.js +5 -5
- package/package.json +2 -2
package/dist/cli-bin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env -S bun --no-env-file
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
// src/cli-bin.ts
|
|
@@ -1211,16 +1211,16 @@ async function checkTool(host, name, bins) {
|
|
|
1211
1211
|
if (version === undefined)
|
|
1212
1212
|
return { check, ok: false, detail: "not installed", fix: `bun install -g ${name}` };
|
|
1213
1213
|
const off = bins.filter((bin) => host.which(bin) === null);
|
|
1214
|
-
if (off.length > 0)
|
|
1215
|
-
return { check, ok: false, detail: `${version}, ${off.join(", ")} not on the PATH`, fix: `add ${join3(host.globalModules, "..", "..", "..", "bin")} to the PATH` };
|
|
1216
1214
|
const info = await host.run(["bun", "info", name, "version", "--no-cache"]);
|
|
1217
1215
|
const answered = info.code === 0 ? firstLine(info.stdout.trim().split(`
|
|
1218
1216
|
`).at(-1) ?? "") : "";
|
|
1219
1217
|
const latest = VERSION.test(answered) ? answered : "";
|
|
1218
|
+
if (latest !== "" && Bun.semver.order(version, latest) < 0)
|
|
1219
|
+
return { check, ok: false, detail: `${version}, ${latest} released${off.length > 0 ? `, ${off.join(", ")} not on the PATH` : ""}`, fix: `bun install -g ${name}@${latest}` };
|
|
1220
|
+
if (off.length > 0)
|
|
1221
|
+
return { check, ok: false, detail: `${version}, ${off.join(", ")} not on the PATH`, fix: `add ${join3(host.globalModules, "..", "..", "..", "bin")} to the PATH` };
|
|
1220
1222
|
if (latest === "")
|
|
1221
1223
|
return { check, ok: true, detail: `${version}, the registry did not answer: ${firstLine(info.stderr) || answered || "no version"}` };
|
|
1222
|
-
if (Bun.semver.order(version, latest) < 0)
|
|
1223
|
-
return { check, ok: false, detail: `${version}, ${latest} released`, fix: `bun install -g ${name}@${latest}` };
|
|
1224
1224
|
return { check, ok: true, detail: version };
|
|
1225
1225
|
}
|
|
1226
1226
|
async function checkTea(host) {
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
1
|
+
#!/usr/bin/env -S bun --no-env-file
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
// src/cli.ts
|
|
@@ -1270,16 +1270,16 @@ async function checkTool(host, name, bins) {
|
|
|
1270
1270
|
if (version === undefined)
|
|
1271
1271
|
return { check, ok: false, detail: "not installed", fix: `bun install -g ${name}` };
|
|
1272
1272
|
const off = bins.filter((bin) => host.which(bin) === null);
|
|
1273
|
-
if (off.length > 0)
|
|
1274
|
-
return { check, ok: false, detail: `${version}, ${off.join(", ")} not on the PATH`, fix: `add ${join4(host.globalModules, "..", "..", "..", "bin")} to the PATH` };
|
|
1275
1273
|
const info = await host.run(["bun", "info", name, "version", "--no-cache"]);
|
|
1276
1274
|
const answered = info.code === 0 ? firstLine(info.stdout.trim().split(`
|
|
1277
1275
|
`).at(-1) ?? "") : "";
|
|
1278
1276
|
const latest = VERSION.test(answered) ? answered : "";
|
|
1277
|
+
if (latest !== "" && Bun.semver.order(version, latest) < 0)
|
|
1278
|
+
return { check, ok: false, detail: `${version}, ${latest} released${off.length > 0 ? `, ${off.join(", ")} not on the PATH` : ""}`, fix: `bun install -g ${name}@${latest}` };
|
|
1279
|
+
if (off.length > 0)
|
|
1280
|
+
return { check, ok: false, detail: `${version}, ${off.join(", ")} not on the PATH`, fix: `add ${join4(host.globalModules, "..", "..", "..", "bin")} to the PATH` };
|
|
1279
1281
|
if (latest === "")
|
|
1280
1282
|
return { check, ok: true, detail: `${version}, the registry did not answer: ${firstLine(info.stderr) || answered || "no version"}` };
|
|
1281
|
-
if (Bun.semver.order(version, latest) < 0)
|
|
1282
|
-
return { check, ok: false, detail: `${version}, ${latest} released`, fix: `bun install -g ${name}@${latest}` };
|
|
1283
1283
|
return { check, ok: true, detail: version };
|
|
1284
1284
|
}
|
|
1285
1285
|
async function checkTea(host) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-doctor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.2",
|
|
5
5
|
"description": "doctor: checks the @kaynooo/cli-* install of a host: each bin's version against the registry, tea's login to Forgejo, the Claude Code hooks and the Bun floor; cli list: every bin in one line, read from its own help.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"doctor": "$npm_execpath src/cli.ts"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@kaynooo/cli-kit": "0.
|
|
39
|
+
"@kaynooo/cli-kit": "0.21.0"
|
|
40
40
|
}
|
|
41
41
|
}
|