From 2c5847c3fc9804b529b6209320fadd3a50f6b9e4 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Sun, 28 Apr 2024 15:02:50 -0700 Subject: [PATCH] feat: call input start/end around spawned process --- lib/run-script-pkg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/run-script-pkg.js b/lib/run-script-pkg.js index a4f27b5..9900c96 100644 --- a/lib/run-script-pkg.js +++ b/lib/run-script-pkg.js @@ -44,6 +44,7 @@ const runScriptPkg = async options => { return { code: 0, signal: null } } + let inputEnd = () => {} if (stdio === 'inherit') { let banner if (pkg._id) { @@ -56,8 +57,9 @@ const runScriptPkg = async options => { banner += ` ${args.join(' ')}` } banner += '\n' - const { output } = require('proc-log') + const { output, input } = require('proc-log') output.standard(banner) + inputEnd = input.start() } const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({ @@ -104,7 +106,7 @@ const runScriptPkg = async options => { } else { throw er } - }) + }).finally(inputEnd) } module.exports = runScriptPkg