From 5c19b1b1f96a475e2ae8d3e808b2a152fa4c0ca7 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Ramesh Date: Thu, 10 Aug 2017 17:48:12 -0700 Subject: [PATCH] Removing a wrong validation check `bin` property of package.json must point to a binary that will be copied by NPM into the NPM Installation's bin directory. This check was assuming users would point to a directory containing the binary and not the binary itself --- example/package.json | 2 +- index.js | 4 ---- package.json | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/example/package.json b/example/package.json index b3f6a5a..d826c5a 100644 --- a/example/package.json +++ b/example/package.json @@ -7,7 +7,7 @@ "install": "go-npm" }, "bin": { - "myBinaryName": "./bin" + "anyCommandNameYouLike": "./bin/myBinaryName" }, "goBinary": { "name": "myBinaryName", diff --git a/index.js b/index.js index db3bdd5..b6404dc 100644 --- a/index.js +++ b/index.js @@ -55,10 +55,6 @@ function validateConfiguration(packageJson) { if (!packageJson.bin || typeof(packageJson.bin) !== "object") { return "'bin' property of package.json must be defined and be an object"; } - - if (packageJson.goBinary.path !== packageJson.bin[packageJson.goBinary.name]) { - return "'bin' property must be a map from 'name' to 'path'. This is necessary for NPM Global install to work"; - } } /** diff --git a/package.json b/package.json index 2915990..fe8ad52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "go-npm", - "version": "0.1.1", + "version": "0.1.2", "description": "Distribute and install Go binaries via NPM", "main": "index.js", "bin": "index.js",