()
| 256 | } |
| 257 | |
| 258 | async setWorkspaces () { |
| 259 | const { relative } = require('node:path') |
| 260 | |
| 261 | const includeWorkspaceRoot = this.isArboristCmd |
| 262 | ? false |
| 263 | : this.npm.config.get('include-workspace-root') |
| 264 | |
| 265 | const prefixInsideCwd = relative(this.npm.localPrefix, process.cwd()).startsWith('..') |
| 266 | const relativeFrom = prefixInsideCwd ? this.npm.localPrefix : process.cwd() |
| 267 | |
| 268 | const filters = this.npm.config.get('workspace') |
| 269 | const getWorkspaces = require('./utils/get-workspaces.js') |
| 270 | const ws = await getWorkspaces(filters, { |
| 271 | path: this.npm.localPrefix, |
| 272 | includeWorkspaceRoot, |
| 273 | relativeFrom, |
| 274 | }) |
| 275 | |
| 276 | this.workspaces = ws |
| 277 | this.workspaceNames = [...ws.keys()] |
| 278 | this.workspacePaths = [...ws.values()] |
| 279 | } |
| 280 | |
| 281 | flags (depth = 1) { |
| 282 | const commandDefinitions = this.constructor.definitions || [] |
no test coverage detected