From c37f1b1986b6daea201226530f14871c28ef0a02 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Fri, 14 Oct 2022 06:49:28 -0500 Subject: [PATCH 1/4] fix install problem --- package.json | 5 +---- postinstall | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100755 postinstall 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..0a30c68 --- /dev/null +++ b/postinstall @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ ! -f ../../node_modules/.bin/electron-rebuild ]; then + cd ../.. + npm install electron-rebuild >/dev/null 2>&1 + cd - +fi +../../node_modules/.bin/electron-rebuild \ No newline at end of file From 1a7522b259baa1d83d4ea037c9f7a30b827fab95 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Mon, 8 Jul 2024 07:00:31 -0500 Subject: [PATCH 2/4] Update postinstall, fix package name --- postinstall | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postinstall b/postinstall index 0a30c68..eb330b9 100755 --- a/postinstall +++ b/postinstall @@ -2,7 +2,7 @@ if [ ! -f ../../node_modules/.bin/electron-rebuild ]; then cd ../.. - npm install electron-rebuild >/dev/null 2>&1 + npm install @electron/rebuild >/dev/null 2>&1 cd - fi -../../node_modules/.bin/electron-rebuild \ No newline at end of file +../../node_modules/.bin/electron-rebuild From bf0924897aad5fe962f84a43d6b4744a472c32db Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 14:46:24 -0600 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ``` From d17788157e0143b62b1fc2ae52de0558655ffc9a Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Mon, 14 Apr 2025 11:45:47 -0500 Subject: [PATCH 4/4] update postinstall for @electron path --- postinstall | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/postinstall b/postinstall index eb330b9..b042a19 100755 --- a/postinstall +++ b/postinstall @@ -1,8 +1,17 @@ #!/bin/bash -if [ ! -f ../../node_modules/.bin/electron-rebuild ]; then - cd ../.. - npm install @electron/rebuild >/dev/null 2>&1 - cd - -fi -../../node_modules/.bin/electron-rebuild +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