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.
@@ -106,10 +106,11 @@ function runDaemon(sessionName, executable, args) {
106
106
  let exitCode = null;
107
107
  const waiters = [];
108
108
  function notifyWaiters() {
109
- while (waiters.length > 0) {
110
- const w = waiters.shift();
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.8",
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
- if (process.argv[1] && /\.(ts|js)$/.test(process.argv[1])) {
366
- return [process.argv[0], process.argv[1]];
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
- return start(["npx", ...args]);
609
+ console.log(`[installing and running: npx ${args.join(" ")}]`);
610
+ return start(["npx", "--yes", ...args]);
599
611
  }
600
612
  }
601
613
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noninteractive",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "noninteractive": "./bin/noninteractive.js"