Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
641 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | const fs = require('graceful-fs')
|
---|
| 4 | const log = require('npmlog')
|
---|
| 5 |
|
---|
| 6 | function list (gyp, args, callback) {
|
---|
| 7 | var devDir = gyp.devDir
|
---|
| 8 | log.verbose('list', 'using node-gyp dir:', devDir)
|
---|
| 9 |
|
---|
| 10 | fs.readdir(devDir, onreaddir)
|
---|
| 11 |
|
---|
| 12 | function onreaddir (err, versions) {
|
---|
| 13 | if (err && err.code !== 'ENOENT') {
|
---|
| 14 | return callback(err)
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | if (Array.isArray(versions)) {
|
---|
| 18 | versions = versions.filter(function (v) { return v !== 'current' })
|
---|
| 19 | } else {
|
---|
| 20 | versions = []
|
---|
| 21 | }
|
---|
| 22 | callback(null, versions)
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | module.exports = list
|
---|
| 27 | module.exports.usage = 'Prints a listing of the currently installed node development files'
|
---|
Note:
See
TracBrowser
for help on using the repository browser.