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(rebuild): don't run lifecycle scripts twice on linked deps #4529

Merged
merged 1 commit into from Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 13 additions & 14 deletions workspaces/arborist/lib/arborist/rebuild.js
Expand Up @@ -136,27 +136,26 @@ module.exports = cls => class Builder extends cls {
process.emit('time', `build:${type}`)

await this[_buildQueues](nodes)
if (!this[_ignoreScripts]) {
await this[_runScripts]('preinstall')
}
if (this[_binLinks] && type !== 'links') {
await this[_linkAllBins]()
}

// links should also run prepare scripts and only link bins after that
if (type === 'links') {
// links should run prepare scripts and only link bins after that
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment sounds off now 🤔 maybe just remove it

if (type !== 'links') {
if (!this[_ignoreScripts]) {
await this[_runScripts]('preinstall')
}
if (this[_binLinks]) {
await this[_linkAllBins]()
}
if (!this[_ignoreScripts]) {
await this[_runScripts]('install')
await this[_runScripts]('postinstall')
}
} else {
await this[_runScripts]('prepare')

if (this[_binLinks]) {
await this[_linkAllBins]()
}
}

if (!this[_ignoreScripts]) {
await this[_runScripts]('install')
await this[_runScripts]('postinstall')
}

process.emit('timeEnd', `build:${type}`)
}

Expand Down