Skip to content
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

fix: dont write log file for completion commands #7497

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class Npm {
// take a long time to resolve, but that is why process.exit is called explicitly
// in the exit-handler.
this.unrefPromises.push(this.#logFile.load({
command,
path: this.logPath,
logsMax: this.config.get('logs-max'),
timing: this.config.get('timing'),
Expand Down
6 changes: 5 additions & 1 deletion lib/utils/log-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class LogFiles {
this.#endStream()
}

load ({ path, logsMax = Infinity, timing } = {}) {
load ({ command, path, logsMax = Infinity, timing } = {}) {
if (['completion'].includes(command)) {
wraithgar marked this conversation as resolved.
Show resolved Hide resolved
return
}

// dir is user configurable and is required to exist so
// this can error if the dir is missing or not configured correctly
this.#path = path
Expand Down
Loading