-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libnpmexec: allow custom stdio option value. #6976
base: latest
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -15,6 +15,7 @@ const run = async ({ | |||
binPaths, | ||||
runPath, | ||||
scriptShell, | ||||
stdio = 'inherit', | ||||
}) => { | ||||
// turn list of args into command string | ||||
const script = call || args.shift() || scriptShell | ||||
|
@@ -31,7 +32,9 @@ const run = async ({ | |||
}, | ||||
} | ||||
|
||||
npmlog.disableProgress() | ||||
if (stdio === 'inherit') { | ||||
npmlog.disableProgress() | ||||
} | ||||
|
||||
try { | ||||
if (script === scriptShell) { | ||||
|
@@ -60,11 +63,13 @@ const run = async ({ | |||
binPaths, | ||||
event: 'npx', | ||||
args, | ||||
stdio: 'inherit', | ||||
stdio, | ||||
scriptShell, | ||||
}) | ||||
} finally { | ||||
npmlog.enableProgress() | ||||
if (stdio === 'inherit') { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one needs to be removed also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is to make the libnpmexec don’t output npm logs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't npm log output, this is progress bars specifically. To suppress all logging we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't want to install npmlog directly to pause it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You already have it
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, I have ora as progress bar. |
||||
npmlog.enableProgress() | ||||
} | ||||
} | ||||
} | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done so that the output from npm doesn't interlace with the output of your script. We always want to disable progress bars during exec.