Comparing version 0.5.0 to 0.5.1
@@ -15,2 +15,3 @@ | ||
, mkdirp = require('mkdirp') | ||
, exec = require('child_process').exec | ||
, win = process.platform == 'win32' | ||
@@ -42,4 +43,3 @@ | ||
log.verbose('`which` succeeded for `' + python + '`', execPath) | ||
// TODO: ensure compatible Python version | ||
getNodeDir() | ||
checkPythonVersion() | ||
}) | ||
@@ -63,3 +63,3 @@ } | ||
} else { | ||
callbackk(err) | ||
callback(err) | ||
} | ||
@@ -69,6 +69,20 @@ return | ||
python = pythonPath | ||
getNodeDir() | ||
checkPythonVersion() | ||
}) | ||
} | ||
function checkPythonVersion () { | ||
exec(python + ' --version', function (err, stdout, stderr) { | ||
if (err) { | ||
return callback(err) | ||
} | ||
var version = stderr.trim().replace(/^python /i, '') | ||
if (semver.lt(version, '3.0.0')) { | ||
getNodeDir() | ||
} else { | ||
failPython3() | ||
} | ||
}) | ||
} | ||
function failNoPython () { | ||
@@ -79,2 +93,8 @@ callback(new Error('Can\'t find Python executable "' + python | ||
function failPython3 () { | ||
callback(new Error('Python executable "' + python | ||
+ '" is Python 3, which is not supported.\n' | ||
+ 'You can set the PYTHON env variable to point to a Python 2 interpreter.')) | ||
} | ||
function getNodeDir () { | ||
@@ -81,0 +101,0 @@ |
@@ -26,3 +26,3 @@ | ||
} | ||
if (versions) { | ||
if (Array.isArray(versions)) { | ||
versions = versions.filter(function (v) { return v != 'current' }) | ||
@@ -29,0 +29,0 @@ } else { |
@@ -31,2 +31,5 @@ | ||
// differentiate node-gyp's logs from npm's | ||
log.heading = 'gyp' | ||
/** | ||
@@ -33,0 +36,0 @@ * The `gyp` function. |
{ "name": "node-gyp" | ||
, "description": "Node.js native addon build tool" | ||
, "keywords": [ "native", "addon", "module", "c", "c++", "bindings", "gyp" ] | ||
, "version": "0.5.0" | ||
, "version": "0.5.1" | ||
, "installVersion": 9 | ||
@@ -6,0 +6,0 @@ , "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
915083
1064
2