Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
17 changes: 17 additions & 0 deletions postinstall
Original file line number Diff line number Diff line change
@@ -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