diff options
author | Gar <gar+gh@danger.computer> | 2021-06-15 20:50:14 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-06-16 00:55:23 +0300 |
commit | 102d4e6fb3c3b02148dbeee977a7d1e6372340d5 (patch) | |
tree | ba2a004abbbcaeab08b839d3fba09992ec07f0ad /lib/workspaces | |
parent | c6a8734d7d6e4b6d061110a01e45e1d418d56489 (diff) |
fix(workspaces): explicitly error in global mode
Also includes a preliminary refactor to consolidate workspace logic now
that every command that supports workspaces has it implemented.
PR-URL: https://github.com/npm/cli/pull/3417
Credit: @wraithgar
Close: #3417
Reviewed-by: @ruyadorno
Diffstat (limited to 'lib/workspaces')
-rw-r--r-- | lib/workspaces/arborist-cmd.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/workspaces/arborist-cmd.js b/lib/workspaces/arborist-cmd.js index 337e7f9d8..cb6b66b8c 100644 --- a/lib/workspaces/arborist-cmd.js +++ b/lib/workspaces/arborist-cmd.js @@ -3,7 +3,6 @@ // be able to run a filtered Arborist.reify() at some point. const BaseCommand = require('../base-command.js') -const getWorkspaces = require('./get-workspaces.js') class ArboristCmd extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ static get params () { @@ -14,10 +13,8 @@ class ArboristCmd extends BaseCommand { } execWorkspaces (args, filters, cb) { - getWorkspaces(filters, { path: this.npm.localPrefix }) - .then(workspaces => { - this.workspaces = [...workspaces.keys()] - this.workspacePaths = [...workspaces.values()] + this.setWorkspaces(filters) + .then(() => { this.exec(args, cb) }) .catch(er => cb(er)) |