arborist-cmd.js 715 B

1234567891011121314151617181920212223242526272829
  1. // This is the base for all commands whose execWorkspaces just gets
  2. // a list of workspace names and passes it on to new Arborist() to
  3. // be able to run a filtered Arborist.reify() at some point.
  4. const BaseCommand = require('../base-command.js')
  5. class ArboristCmd extends BaseCommand {
  6. get isArboristCmd () {
  7. return true
  8. }
  9. /* istanbul ignore next - see test/lib/load-all-commands.js */
  10. static get params () {
  11. return [
  12. 'workspace',
  13. 'workspaces',
  14. 'include-workspace-root',
  15. ]
  16. }
  17. execWorkspaces (args, filters, cb) {
  18. this.setWorkspaces(filters, true)
  19. .then(() => {
  20. this.exec(args, cb)
  21. })
  22. .catch(er => cb(er))
  23. }
  24. }
  25. module.exports = ArboristCmd