We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 577f430 commit 24ec928Copy full SHA for 24ec928
src/utils/path-resolve.ts
@@ -176,14 +176,17 @@ export function findBinPathDetailsSync(binName: string): {
176
all: true,
177
nothrow: true
178
}) ?? []
179
- const binPath = bins.find((binPath, i) => {
+ let binPath: string | undefined
180
+ for (let i = 0, { length } = bins; i < length; i += 1) {
181
+ const bin = realpathSync.native(bins[i]!)
182
// Skip our bin directory if it's in the front.
- if (realpathSync(path.dirname(binPath)) === shadowBinPath) {
183
+ if (path.dirname(bin) === shadowBinPath) {
184
shadowIndex = i
- return false
185
+ } else {
186
+ binPath = bin
187
+ break
188
}
- return true
- })
189
+ }
190
return { name: binName, path: binPath, shadowed: shadowIndex !== -1 }
191
192
0 commit comments