mirror of
https://github.com/ershisan99/go-npm.git
synced 2025-12-16 12:33:24 +00:00
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
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"install": "go-npm"
|
"install": "go-npm"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"myBinaryName": "./bin"
|
"anyCommandNameYouLike": "./bin/myBinaryName"
|
||||||
},
|
},
|
||||||
"goBinary": {
|
"goBinary": {
|
||||||
"name": "myBinaryName",
|
"name": "myBinaryName",
|
||||||
|
|||||||
4
index.js
4
index.js
@@ -55,10 +55,6 @@ function validateConfiguration(packageJson) {
|
|||||||
if (!packageJson.bin || typeof(packageJson.bin) !== "object") {
|
if (!packageJson.bin || typeof(packageJson.bin) !== "object") {
|
||||||
return "'bin' property of package.json must be defined and be an 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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "go-npm",
|
"name": "go-npm",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"description": "Distribute and install Go binaries via NPM",
|
"description": "Distribute and install Go binaries via NPM",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": "index.js",
|
"bin": "index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user