blob: 20e13f160f2761042d26548e1337ddc074f40cdc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
const envPath = require('./utils/path.js')
const BaseCommand = require('./base-command.js')
class Bin extends BaseCommand {
static get description () {
return 'Display npm bin folder'
}
static get name () {
return 'bin'
}
static get params () {
return ['global']
}
exec (args, cb) {
this.bin(args).then(() => cb()).catch(cb)
}
async bin (args) {
const b = this.npm.bin
this.npm.output(b)
if (this.npm.config.get('global') && !envPath.includes(b))
console.error('(not in PATH env variable)')
}
}
module.exports = Bin
|