@npmcli/arborist 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -136,15 +136,19 @@ module.exports = cls => class Builder extends cls {
136
136
  process.emit('time', `build:${type}`)
137
137
 
138
138
  await this[_buildQueues](nodes)
139
- if (!this[_ignoreScripts]) {
140
- await this[_runScripts]('preinstall')
141
- }
142
- if (this[_binLinks] && type !== 'links') {
143
- await this[_linkAllBins]()
144
- }
145
-
146
- // links should also run prepare scripts and only link bins after that
147
- if (type === 'links') {
139
+ // links should run prepare scripts and only link bins after that
140
+ if (type !== 'links') {
141
+ if (!this[_ignoreScripts]) {
142
+ await this[_runScripts]('preinstall')
143
+ }
144
+ if (this[_binLinks]) {
145
+ await this[_linkAllBins]()
146
+ }
147
+ if (!this[_ignoreScripts]) {
148
+ await this[_runScripts]('install')
149
+ await this[_runScripts]('postinstall')
150
+ }
151
+ } else {
148
152
  await this[_runScripts]('prepare')
149
153
 
150
154
  if (this[_binLinks]) {
@@ -152,11 +156,6 @@ module.exports = cls => class Builder extends cls {
152
156
  }
153
157
  }
154
158
 
155
- if (!this[_ignoreScripts]) {
156
- await this[_runScripts]('install')
157
- await this[_runScripts]('postinstall')
158
- }
159
-
160
159
  process.emit('timeEnd', `build:${type}`)
161
160
  }
162
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@isaacs/string-locale-compare": "^1.1.0",