prefix.js 729 B

1234567891011121314151617181920212223242526272829303132
  1. const BaseCommand = require('./base-command.js')
  2. class Prefix extends BaseCommand {
  3. /* istanbul ignore next - see test/lib/load-all-commands.js */
  4. static get description () {
  5. return 'Display prefix'
  6. }
  7. /* istanbul ignore next - see test/lib/load-all-commands.js */
  8. static get name () {
  9. return 'prefix'
  10. }
  11. /* istanbul ignore next - see test/lib/load-all-commands.js */
  12. static get params () {
  13. return ['global']
  14. }
  15. /* istanbul ignore next - see test/lib/load-all-commands.js */
  16. static get usage () {
  17. return ['[-g]']
  18. }
  19. exec (args, cb) {
  20. this.prefix(args).then(() => cb()).catch(cb)
  21. }
  22. async prefix (args) {
  23. return this.npm.output(this.npm.prefix)
  24. }
  25. }
  26. module.exports = Prefix