summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/lib/node-gyp.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/node-gyp/lib/node-gyp.js')
-rw-r--r--deps/npm/node_modules/node-gyp/lib/node-gyp.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js
index fae8e1391b..5902632489 100644
--- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js
+++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js
@@ -1,4 +1,8 @@
+/**
+ * Module exports.
+ */
+
module.exports = exports = gyp
/**
@@ -36,7 +40,7 @@ log.heading = 'gyp'
*/
function gyp () {
- return new Gyp
+ return new Gyp()
}
function Gyp () {
@@ -46,6 +50,12 @@ function Gyp () {
// TODO: make this *more* configurable?
// see: https://github.com/TooTallNate/node-gyp/issues/21
var homeDir = process.env.HOME || process.env.USERPROFILE
+ if (!homeDir) {
+ throw new Error(
+ "node-gyp requires that the user's home directory is specified " +
+ "in either of the environmental variables HOME or USERPROFILE"
+ );
+ }
this.devDir = path.resolve(homeDir, '.node-gyp')
this.commands = {}
@@ -97,6 +107,7 @@ proto.shorthands = {
release: '--no-debug'
, C: '--directory'
, debug: '--debug'
+ , j: '--jobs'
, silly: '--loglevel=silly'
, verbose: '--loglevel=verbose'
}
@@ -119,7 +130,7 @@ proto.parseArgv = function parseOpts (argv) {
var commands = this.todo = []
// create a copy of the argv array with aliases mapped
- var argv = this.argv.map(function (arg) {
+ argv = this.argv.map(function (arg) {
// is this an alias?
if (arg in this.aliases) {
arg = this.aliases[arg]
@@ -167,7 +178,7 @@ proto.parseArgv = function parseOpts (argv) {
*/
proto.spawn = function spawn (command, args, opts) {
- opts || (opts = {})
+ if (!opts) opts = {}
if (!opts.silent && !opts.customFds) {
opts.customFds = [ 0, 1, 2 ]
}
@@ -182,7 +193,7 @@ proto.spawn = function spawn (command, args, opts) {
*/
proto.usage = function usage () {
- var usage = [
+ var str = [
''
, ' Usage: node-gyp <command> [options]'
, ''
@@ -197,7 +208,7 @@ proto.usage = function usage () {
, 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..')
, 'node@' + process.versions.node
].join('\n')
- return usage
+ return str
}
/**