terminalhire 0.40.5 → 0.40.6
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/jpi-statusline.js +1 -1
- package/package.json +1 -1
- package/statusline-install.js +22 -4
|
@@ -59,7 +59,7 @@ function localVersion() {
|
|
|
59
59
|
for (const p of [join(here, "..", "..", "package.json"), join(here, "..", "package.json")]) {
|
|
60
60
|
try {
|
|
61
61
|
const pkg = JSON.parse(readFileSync(p, "utf8"));
|
|
62
|
-
if (pkg.version) return pkg.version;
|
|
62
|
+
if (pkg.name === "terminalhire" && pkg.version) return pkg.version;
|
|
63
63
|
} catch {
|
|
64
64
|
}
|
|
65
65
|
}
|
package/package.json
CHANGED
package/statusline-install.js
CHANGED
|
@@ -305,10 +305,28 @@ async function install({ ask: injectedAsk } = {}) {
|
|
|
305
305
|
asker.close();
|
|
306
306
|
return 0;
|
|
307
307
|
}
|
|
308
|
-
} else
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
} else {
|
|
309
|
+
// ALLOWLIST, not a denylist. The first version of this asked "is it n or no?"
|
|
310
|
+
// and installed on everything else — which meant `null` installed, and `ask`
|
|
311
|
+
// resolves null on EOF, on Ctrl-D, and whenever the shared readline closes
|
|
312
|
+
// because the human bailed out of `init` mid-flow. `String(null ?? '')` is the
|
|
313
|
+
// empty string, indistinguishable from pressing Enter. So did "nope", "cancel",
|
|
314
|
+
// and an `n` still wrapped in bracketed-paste bytes. Under the old literal-"yes"
|
|
315
|
+
// bar every one of those aborted; a denylist silently turned each into consent
|
|
316
|
+
// to write another program's config file.
|
|
317
|
+
//
|
|
318
|
+
// The `th://` prompt eight steps below in the same flow (jpi-init.js) already
|
|
319
|
+
// allowlists `'' | y | yes`. Two consecutive consent prompts disagreeing about
|
|
320
|
+
// which way an unrecognised answer falls is how a regression gets waved through.
|
|
321
|
+
const a = String(answer ?? '')
|
|
322
|
+
.trim()
|
|
323
|
+
.toLowerCase();
|
|
324
|
+
const consented = answer !== null && (a === '' || a === 'y' || a === 'yes');
|
|
325
|
+
if (!consented) {
|
|
326
|
+
console.log('\nAborted — nothing was changed.');
|
|
327
|
+
asker.close();
|
|
328
|
+
return 0;
|
|
329
|
+
}
|
|
312
330
|
}
|
|
313
331
|
|
|
314
332
|
const src = resolveLauncherSource();
|