terminalhire 0.40.5 → 0.40.7
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 +26 -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,32 @@ 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
|
+
// Narrow by TYPE, not by listing the non-strings that must not consent. Excluding
|
|
322
|
+
// `null` by value left `undefined` consenting — `String(undefined ?? '')` is also
|
|
323
|
+
// the empty string — so the guard only closed the hole it had already been shown.
|
|
324
|
+
// Both real askers resolve `string | null` today, which is exactly why this must
|
|
325
|
+
// not depend on that: a third `ask` is one refactor away, and it would arrive as
|
|
326
|
+
// the same EOF bug wearing a different value.
|
|
327
|
+
const a = typeof answer === 'string' ? answer.trim().toLowerCase() : null;
|
|
328
|
+
const consented = a === '' || a === 'y' || a === 'yes';
|
|
329
|
+
if (!consented) {
|
|
330
|
+
console.log('\nAborted — nothing was changed.');
|
|
331
|
+
asker.close();
|
|
332
|
+
return 0;
|
|
333
|
+
}
|
|
312
334
|
}
|
|
313
335
|
|
|
314
336
|
const src = resolveLauncherSource();
|