diff --git a/README.md b/README.md index 7190c1d..aaf2621 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For example this can be used to send notifications to the following modules: Clone this repository in your `modules` folder, and install dependencies: ```bash cd ~/MagicMirror/modules # adapt directory if you are using a different one -git clone https://github.com/Jopyth/MMM-Buttons.git +git clone https://github.com/sdetweil/MMM-Buttons.git cd MMM-Buttons npm install # this can take a while ``` diff --git a/package.json b/package.json index 5766223..9c819a5 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,9 @@ }, "homepage": "git+https://github.com/jopyth/MMM-Buttons#readme", "scripts": { - "postinstall": "node_modules/.bin/electron-rebuild -e ../../node_modules/electron" + "postinstall": "./postinstall" }, "dependencies": { "onoff": "latest" - }, - "devDependencies": { - "electron-rebuild": "^1.2.1" } } diff --git a/postinstall b/postinstall new file mode 100755 index 0000000..b042a19 --- /dev/null +++ b/postinstall @@ -0,0 +1,17 @@ +#!/bin/bash + +base=~/MagicMirror +logfile=/dev/null +if [ ! -e $base/node_modules/@electron/rebuild ]; then + cd $base + if [ -e $base/node_modules/.bin/electron-rebuild ]; then + # remove the old version + npm uninstall electron-rebuild >>$logfile 2>&1 + fi + # install the new version + npm install @electron/rebuild >>$logfile 2>&1 + cd - >/dev/null +fi + + +$base/node_modules/.bin/electron-rebuild