diff options
author | isaacs <i@izs.me> | 2013-07-11 11:23:08 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-07-11 11:23:08 +0400 |
commit | eb205fe60b5718f54735c357a01e38b7728846aa (patch) | |
tree | 8eae0a3e7400c2018bfc8d467bce3c9d2dcdc48d /node_modules/node-gyp/lib | |
parent | 4c38a23096d0087fbe5ce81c2b1556b06db8cf9d (diff) |
node-gyp@0.10.6
Diffstat (limited to 'node_modules/node-gyp/lib')
-rw-r--r-- | node_modules/node-gyp/lib/configure.js | 13 | ||||
-rw-r--r-- | node_modules/node-gyp/lib/remove.js | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js index 437b839ca..37c9ad37d 100644 --- a/node_modules/node-gyp/lib/configure.js +++ b/node_modules/node-gyp/lib/configure.js @@ -101,7 +101,12 @@ function configure (gyp, argv, callback) { log.silly('stripping "+" sign(s) from version') version = version.replace(/\+/g, '') } - if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) { + if (~version.indexOf('rc')) { + log.silly('stripping "rc" identifier from version') + version = version.replace(/rc(.*)$/ig, '') + } + var range = semver.Range('>=2.5.0 <3.0.0'); + if (range.test(version)) { getNodeDir() } else { failPythonVersion(version) @@ -209,7 +214,11 @@ function configure (gyp, argv, callback) { } // make sure we have a valid version - version = semver.parse(versionStr) + try { + version = semver.parse(versionStr) + } catch (e) { + return callback(e) + } if (!version) { return callback(new Error('Invalid version number: ' + versionStr)) } diff --git a/node_modules/node-gyp/lib/remove.js b/node_modules/node-gyp/lib/remove.js index 44f3147a2..068d1e389 100644 --- a/node_modules/node-gyp/lib/remove.js +++ b/node_modules/node-gyp/lib/remove.js @@ -34,7 +34,7 @@ function remove (gyp, argv, callback) { } // flatten the version Array into a String - version = version.slice(1, 4).join('.') + version = version.version var versionPath = path.resolve(gyp.devDir, version) log.verbose('remove', 'removing development files for version:', version) |