From 677bd348a750f362a4d23f32a5c48bfbbd725653 Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Tue, 7 Jan 2020 12:46:19 -0600 Subject: [PATCH] Don't use node -e require for npm installer --- npm/install.js | 4 ++++ npm/package.json | 4 ++-- npm/run.js | 2 +- npm/uninstall.js | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 npm/install.js create mode 100644 npm/uninstall.js diff --git a/npm/install.js b/npm/install.js new file mode 100644 index 0000000..9b5bba1 --- /dev/null +++ b/npm/install.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +const { install } = require("./binary"); +install(); diff --git a/npm/package.json b/npm/package.json index 71eba27..e525c54 100644 --- a/npm/package.json +++ b/npm/package.json @@ -4,8 +4,8 @@ "description": "📦✨ your favorite rust -> wasm workflow tool!", "main": "binary.js", "scripts": { - "postinstall": "node -e 'require(\"./binary.js\").install()'", - "preuninstall": "node -e 'require(\"./binary.js\").uninstall()'" + "postinstall": "node ./install.js", + "preuninstall": "node ./uninstall.js" }, "bin": { "wasm-pack": "./run.js" diff --git a/npm/run.js b/npm/run.js index 4b0b896..847da53 100755 --- a/npm/run.js +++ b/npm/run.js @@ -1,4 +1,4 @@ #!/usr/bin/env node const { run } = require("./binary"); -run() \ No newline at end of file +run(); diff --git a/npm/uninstall.js b/npm/uninstall.js new file mode 100644 index 0000000..56088ad --- /dev/null +++ b/npm/uninstall.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +const { uninstall } = require("./binary"); +uninstall();