If we move the npm.config.get('workspace')
out of lib/npm.js
and let the execWorkspaces
functions do that themselves it will be more clear inside the exec functions what's going on, and likely lead to more optimizations down the road inside each command (i.e. set a "use workspaces" flag and reuse all the rest of the code or something).
This should wait till the velocity on adding workspace-aware commands has slowed down. This is cleanup for afterwards.
Alternatively we could move the getWorkspaces
util function up into lib/npm.js itself, so that what execWorkspaces
gets passed is already standardized off of what's in there.