From 921f161b537224041bef596f9ab3c251079847f3 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Ramesh Date: Mon, 7 Aug 2017 23:37:01 -0700 Subject: [PATCH] Do a global replace for URL interpolation --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 721e02f..db3bdd5 100644 --- a/index.js +++ b/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 // Interpolate variables in URL, if necessary - url = url.replace("{{arch}}", ARCH_MAPPING[process.arch]); - url = url.replace("{{platform}}", PLATFORM_MAPPING[process.platform]); - url = url.replace("{{version}}", version); - url = url.replace("{{bin_name}}", binName); + url = url.replace(/{{arch}}/g, ARCH_MAPPING[process.arch]); + url = url.replace(/{{platform}}/g, PLATFORM_MAPPING[process.platform]); + url = url.replace(/{{version}}/g, version); + url = url.replace(/{{bin_name}}/g, binName); mkdirp.sync(binPath);