Windows binaries get a .exe extension

This commit is contained in:
Sanath Kumar Ramesh
2017-08-10 23:06:34 -07:00
parent a3d7ec2081
commit 6e80d13fea
2 changed files with 6 additions and 1 deletions

View File

@@ -123,6 +123,11 @@ function parsePackageJson() {
let version = packageJson.version;
if (version[0] === 'v') version = version.substr(1); // strip the 'v' if necessary v0.0.1 => 0.0.1
// Binary name on Windows has .exe suffix
if (process.platform === "win32") {
binName += ".exe"
}
// Interpolate variables in URL, if necessary
url = url.replace(/{{arch}}/g, ARCH_MAPPING[process.arch]);
url = url.replace(/{{platform}}/g, PLATFORM_MAPPING[process.platform]);

View File

@@ -1,6 +1,6 @@
{
"name": "go-npm",
"version": "0.1.5",
"version": "0.1.6",
"description": "Distribute and install Go binaries via NPM",
"main": "index.js",
"bin": "index.js",