mirror of
https://github.com/ershisan99/go-npm.git
synced 2025-12-17 05:09:30 +00:00
Do a global replace for URL interpolation
This commit is contained in:
8
index.js
8
index.js
@@ -103,10 +103,10 @@ function install(callback) {
|
|||||||
if (version[0] === 'v') version = version.substr(1); // strip the 'v' if necessary v0.0.1 => 0.0.1
|
if (version[0] === 'v') version = version.substr(1); // strip the 'v' if necessary v0.0.1 => 0.0.1
|
||||||
|
|
||||||
// Interpolate variables in URL, if necessary
|
// Interpolate variables in URL, if necessary
|
||||||
url = url.replace("{{arch}}", ARCH_MAPPING[process.arch]);
|
url = url.replace(/{{arch}}/g, ARCH_MAPPING[process.arch]);
|
||||||
url = url.replace("{{platform}}", PLATFORM_MAPPING[process.platform]);
|
url = url.replace(/{{platform}}/g, PLATFORM_MAPPING[process.platform]);
|
||||||
url = url.replace("{{version}}", version);
|
url = url.replace(/{{version}}/g, version);
|
||||||
url = url.replace("{{bin_name}}", binName);
|
url = url.replace(/{{bin_name}}/g, binName);
|
||||||
|
|
||||||
|
|
||||||
mkdirp.sync(binPath);
|
mkdirp.sync(binPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user