blob: 6ecf1ba860a5ffc8f817c8301a61d5c2ef5d431e (
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
29
30
31
32
33
34
|
module.exports = exports = list
exports.usage = 'Prints a listing of the currently installed node development files'
/**
* Module dependencies.
*/
var fs = require('fs')
, path = require('path')
function list (gyp, args, callback) {
// TODO: Make ~/.node-gyp configurable
var nodeGypDir = path.resolve(process.env.HOME, '.node-gyp')
gyp.verbose('using node-gyp dir', nodeGypDir)
// readdir the node-gyp dir
fs.readdir(nodeGypDir, onreaddir)
function onreaddir (err, versions) {
if (err && err.code != 'ENOENT') {
return callback(err)
}
if (versions) {
versions = versions.filter(function (v) { return v != 'current' })
} else {
versions = []
}
callback(null, versions)
}
}
|