Do not run npm postinstall from repo

This commit is contained in:
Wilson Lin 2020-07-11 23:33:44 +10:00
parent 996a531147
commit 573c88c67f
3 changed files with 3 additions and 3 deletions

0
nodejs/.no-postinstall Normal file
View File

View File

@ -5,13 +5,13 @@
"main": "dist/index.js", "main": "dist/index.js",
"files": [ "files": [
"dist/**", "dist/**",
"install.js" "postinstall.js"
], ],
"scripts": { "scripts": {
"build": "npm run clean && tsc", "build": "npm run clean && tsc",
"build-binary": "neon build --release && mv native/index.node dist/native.node", "build-binary": "neon build --release && mv native/index.node dist/native.node",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"postinstall": "node install.js" "postinstall": "node postinstall.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -47,7 +47,7 @@ const downloadNativeBinary = async () => {
} }
}; };
if (!fs.existsSync(binaryPath)) { if (!fs.existsSync(path.join(__dirname, '.no-postinstall')) && !fs.existsSync(binaryPath)) {
downloadNativeBinary() downloadNativeBinary()
.then( .then(
() => console.log(`Downloaded ${pkg.name}`), () => console.log(`Downloaded ${pkg.name}`),