Skip to content

Commit 5a1cb5b

Browse files
committed
Fix isStdioType for type 'pipe'
1 parent 453f585 commit 5a1cb5b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

registry/lib/spawn.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function getSpawn() {
2828
function isStdioType(stdio, type) {
2929
return (
3030
stdio === type ||
31+
(!stdio && type === 'pipe') ||
3132
(Array.isArray(stdio) &&
3233
stdio.length > 2 &&
3334
stdio[0] === type &&
@@ -60,9 +61,10 @@ function spawn(cmd, args, options, extra) {
6061
const { env, stdio, stdioString = true } = spawnOptions
6162
// The stdio option can be a string or an array.
6263
// https://nodejs.org/api/child_process.html#optionsstdio
63-
const shouldPauseSpinner =
64+
const shouldStopSpinner =
6465
isSpinning && !isStdioType(stdio, 'ignore') && !isStdioType(stdio, 'pipe')
65-
if (shouldPauseSpinner) {
66+
const shouldRestartSpinner = shouldStopSpinner
67+
if (shouldStopSpinner) {
6668
spinner.stop()
6769
}
6870
let spawnPromise = spawn(
@@ -90,7 +92,7 @@ function spawn(cmd, args, options, extra) {
9092
throw stripAnsiFromSpawnResult(error)
9193
})
9294
}
93-
if (shouldPauseSpinner) {
95+
if (shouldRestartSpinner) {
9496
spawnPromise = spawnPromise.finally(() => {
9597
spinner.start()
9698
})

0 commit comments

Comments
 (0)