| 19 | static checkDevEngines = true |
| 20 | |
| 21 | constructor (npm) { |
| 22 | super(npm) |
| 23 | |
| 24 | const { config } = this.npm |
| 25 | |
| 26 | // when location isn't set and global isn't true check for a package.json at the localPrefix and set the location to project if found |
| 27 | const locationProject = config.get('location') === 'project' || ( |
| 28 | config.isDefault('location') |
| 29 | // this is different then `npm.global` which falls back to checking |
| 30 | // location which we do not want to use here |
| 31 | && !config.get('global') |
| 32 | && npm.localPackage |
| 33 | ) |
| 34 | |
| 35 | // if audit is not set and we are in global mode and location is not project and we assume its not a project related context, then we set audit=false |
| 36 | if (config.isDefault('audit') && (this.npm.global || !locationProject)) { |
| 37 | config.set('audit', false) |
| 38 | } else if (this.npm.global && config.get('audit')) { |
| 39 | log.warn('config', 'includes both --global and --audit, which is currently unsupported.') |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | async execWorkspaces (args) { |
| 44 | await this.setWorkspaces() |