From 573c88c67f730b0d348f12ebfb2da5cd6b8f642e Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Sat, 11 Jul 2020 23:33:44 +1000 Subject: [PATCH] Do not run npm postinstall from repo --- nodejs/.no-postinstall | 0 nodejs/package.json | 4 ++-- nodejs/{install.js => postinstall.js} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 nodejs/.no-postinstall rename nodejs/{install.js => postinstall.js} (94%) diff --git a/nodejs/.no-postinstall b/nodejs/.no-postinstall new file mode 100644 index 0000000..e69de29 diff --git a/nodejs/package.json b/nodejs/package.json index 849e882..7b5ad47 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,13 +5,13 @@ "main": "dist/index.js", "files": [ "dist/**", - "install.js" + "postinstall.js" ], "scripts": { "build": "npm run clean && tsc", "build-binary": "neon build --release && mv native/index.node dist/native.node", "clean": "rm -rf dist", - "postinstall": "node install.js" + "postinstall": "node postinstall.js" }, "repository": { "type": "git", diff --git a/nodejs/install.js b/nodejs/postinstall.js similarity index 94% rename from nodejs/install.js rename to nodejs/postinstall.js index 5f13548..7c09cb3 100644 --- a/nodejs/install.js +++ b/nodejs/postinstall.js @@ -47,7 +47,7 @@ const downloadNativeBinary = async () => { } }; -if (!fs.existsSync(binaryPath)) { +if (!fs.existsSync(path.join(__dirname, '.no-postinstall')) && !fs.existsSync(binaryPath)) { downloadNativeBinary() .then( () => console.log(`Downloaded ${pkg.name}`),