diff options
author | Alain Kalker <a.c.kalker@gmail.com> | 2014-03-16 11:56:48 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-02-27 04:09:45 +0300 |
commit | 145af6587f45de135cc876be2027ed818ed4ca6a (patch) | |
tree | 0fb754004da727b4a8533385e8356273be91043c /bin | |
parent | d3cb6e1ff82d8cae7610b6c0ad751913d09846b6 (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-x | bin/node-gyp-bin/node-gyp | 6 | ||||
-rwxr-xr-x | bin/node-gyp-bin/node-gyp.cmd | 6 |
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% %*
+)
|