Skip to content

Commit dd6530e

Browse files
committed
fix(libnpmexec): workspaces support
Fixes the proper path location to use when targetting specific workspaces. Makes it so that libnpmexec is always reading from the Arborist actual tree instead of reading `node_modules` from the file system when retrieving local package data. Fixes: #3520 Relates to: #4619 Relates to: npm/statusboard#403
1 parent ff1367f commit dd6530e

File tree

6 files changed

+371
-116
lines changed

6 files changed

+371
-116
lines changed

lib/commands/exec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ class Exec extends BaseCommand {
4848
static ignoreImplicitWorkspace = false
4949
static isShellout = true
5050

51-
async exec (_args, { locationMsg, path, runPath } = {}) {
52-
if (!path) {
53-
path = this.npm.localPrefix
54-
}
51+
async exec (_args, { locationMsg, runPath } = {}) {
52+
const path = this.npm.localPrefix
5553

5654
if (!runPath) {
5755
runPath = process.cwd()
@@ -95,7 +93,7 @@ class Exec extends BaseCommand {
9593

9694
for (const path of this.workspacePaths) {
9795
const locationMsg = await getLocationMsg({ color, path })
98-
await this.exec(args, { locationMsg, path, runPath: path })
96+
await this.exec(args, { locationMsg, runPath: path })
9997
}
10098
}
10199
}

0 commit comments

Comments
 (0)