From 145af6587f45de135cc876be2027ed818ed4ca6a Mon Sep 17 00:00:00 2001 From: Alain Kalker Date: Sun, 16 Mar 2014 08:56:48 +0100 Subject: 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= --- bin/node-gyp-bin/node-gyp | 6 +++++- bin/node-gyp-bin/node-gyp.cmd | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'bin') 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% %* +) -- cgit v1.2.3