Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-06-25 08:00:11 +0400
committerisaacs <i@izs.me>2013-06-25 08:03:16 +0400
commit3426f4cab51a77e4de9f6180db5ca37744c67efb (patch)
tree01cfbfc1b76185e2c7121f138eced77d7c030447 /node_modules/node-gyp/lib/node-gyp.js
parent29f5a3321c69103d91726f277515dbb6410f122c (diff)
node-gyp@0.10.2
Diffstat (limited to 'node_modules/node-gyp/lib/node-gyp.js')
-rw-r--r--node_modules/node-gyp/lib/node-gyp.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/node_modules/node-gyp/lib/node-gyp.js b/node_modules/node-gyp/lib/node-gyp.js
index 37d2e5061..590263248 100644
--- a/node_modules/node-gyp/lib/node-gyp.js
+++ b/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 = {}
@@ -120,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]
@@ -168,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 ]
}
@@ -183,7 +193,7 @@ proto.spawn = function spawn (command, args, opts) {
*/
proto.usage = function usage () {
- var usage = [
+ var str = [
''
, ' Usage: node-gyp <command> [options]'
, ''
@@ -198,7 +208,7 @@ proto.usage = function usage () {
, 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..')
, 'node@' + process.versions.node
].join('\n')
- return usage
+ return str
}
/**