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
path: root/bin
diff options
context:
space:
mode:
authorAlain Kalker <a.c.kalker@gmail.com>2014-03-16 11:56:48 +0400
committerForrest L Norvell <forrest@npmjs.com>2015-02-27 04:09:45 +0300
commit145af6587f45de135cc876be2027ed818ed4ca6a (patch)
tree0fb754004da727b4a8533385e8356273be91043c /bin
parentd3cb6e1ff82d8cae7610b6c0ad751913d09846b6 (diff)
node-gyp: enable overriding node-gyp binary
Enable overriding the node-gyp binary used by npm by specifying a config option, similar to specifying the python interpreter. Example usage: npm install --node-gyp=<path-to-custom-node-gyp>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/node-gyp-bin/node-gyp6
-rwxr-xr-xbin/node-gyp-bin/node-gyp.cmd6
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/node-gyp-bin/node-gyp b/bin/node-gyp-bin/node-gyp
index 345f07a18..70efb6f33 100755
--- a/bin/node-gyp-bin/node-gyp
+++ b/bin/node-gyp-bin/node-gyp
@@ -1,2 +1,6 @@
#!/usr/bin/env sh
-node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
+if [ "x$npm_config_node_gyp" = "x" ]; then
+ node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
+else
+ "$npm_config_node_gyp" "$@"
+fi
diff --git a/bin/node-gyp-bin/node-gyp.cmd b/bin/node-gyp-bin/node-gyp.cmd
index c2563ea11..a05fd8cae 100755
--- a/bin/node-gyp-bin/node-gyp.cmd
+++ b/bin/node-gyp-bin/node-gyp.cmd
@@ -1 +1,5 @@
-node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
+if not defined npm_config_node_gyp (
+ node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
+) else (
+ %npm_config_node_gyp% %*
+)