Skip to content

Commit

Permalink
feat: call input start/end around spawned process
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 28, 2024
1 parent 8417f1b commit f8e3425
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 @@ -4,6 +4,7 @@ const packageEnvs = require('./package-envs.js')
const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp')
const signalManager = require('./signal-manager.js')
const isServerPackage = require('./is-server-package.js')
const { output, input } = require('proc-log')

const runScriptPkg = async options => {
const {
Expand Down Expand Up @@ -44,6 +45,7 @@ const runScriptPkg = async options => {
return { code: 0, signal: null }
}

let inputEnd = () => {}
if (stdio === 'inherit') {
let banner
if (pkg._id) {
Expand All @@ -56,8 +58,8 @@ const runScriptPkg = async options => {
banner += ` ${args.join(' ')}`
}
banner += '\n'
const { output } = 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 f8e3425

Please sign in to comment.