noninteractive 0.3.8 → 0.3.10
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/bin/noninteractive.js +18 -6
- package/package.json +1 -1
package/bin/noninteractive.js
CHANGED
|
@@ -106,10 +106,11 @@ function runDaemon(sessionName, executable, args) {
|
|
|
106
106
|
let exitCode = null;
|
|
107
107
|
const waiters = [];
|
|
108
108
|
function notifyWaiters() {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
let w = waiters.shift();
|
|
110
|
+
while (w) {
|
|
111
111
|
clearTimeout(w.timer);
|
|
112
112
|
w.resolve(outputBuffer);
|
|
113
|
+
w = waiters.shift();
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
const ptyBridge = getPtyBridge();
|
|
@@ -242,7 +243,7 @@ var init_daemon = __esm(() => {
|
|
|
242
243
|
var require_package = __commonJS((exports, module) => {
|
|
243
244
|
module.exports = {
|
|
244
245
|
name: "noninteractive",
|
|
245
|
-
version: "0.3.
|
|
246
|
+
version: "0.3.10",
|
|
246
247
|
type: "module",
|
|
247
248
|
bin: {
|
|
248
249
|
noninteractive: "./bin/noninteractive.js"
|
|
@@ -362,8 +363,18 @@ more examples:
|
|
|
362
363
|
npx noninteractive supabase init # session "supabase"
|
|
363
364
|
npx noninteractive start vercel login # explicit start for non-npx commands`;
|
|
364
365
|
function getSelfCommand() {
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
const script = process.argv[1];
|
|
367
|
+
if (!script)
|
|
368
|
+
return [process.argv[0]];
|
|
369
|
+
const { realpathSync } = __require("fs");
|
|
370
|
+
try {
|
|
371
|
+
const real = realpathSync(script);
|
|
372
|
+
if (/\.(ts|js)$/.test(real)) {
|
|
373
|
+
return [process.argv[0], real];
|
|
374
|
+
}
|
|
375
|
+
} catch {}
|
|
376
|
+
if (/\.(ts|js)$/.test(script)) {
|
|
377
|
+
return [process.argv[0], script];
|
|
367
378
|
}
|
|
368
379
|
return [process.argv[0]];
|
|
369
380
|
}
|
|
@@ -595,7 +606,8 @@ example: npx noninteractive stop vercel`);
|
|
|
595
606
|
console.log(HELP);
|
|
596
607
|
break;
|
|
597
608
|
default:
|
|
598
|
-
|
|
609
|
+
console.log(`[installing and running: npx ${args.join(" ")}]`);
|
|
610
|
+
return start(["npx", "--yes", ...args]);
|
|
599
611
|
}
|
|
600
612
|
}
|
|
601
613
|
main().catch((err) => {
|