Skip to content

Commit

Permalink
feat: call input start/end around spawned process (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 29, 2024
1 parent 8417f1b commit afb3db4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/run-script-pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const runScriptPkg = async options => {
return { code: 0, signal: null }
}

let inputEnd = () => {}
if (stdio === 'inherit') {
let banner
if (pkg._id) {
Expand All @@ -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({
Expand Down Expand Up @@ -104,7 +106,7 @@ const runScriptPkg = async options => {
} else {
throw er
}
})
}).finally(inputEnd)
}

module.exports = runScriptPkg

0 comments on commit afb3db4

Please sign in to comment.