Read the statement by Michael Teeuw here.
Updating to latest MM version
-
I created the following script that updates MM and the modules that i use.
The script is scheduled to run via a systemd timer at a given date and time :#!/bin/bash
cd ~/MagicMirror
git reset --hard
bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/upgrade-script.sh)” apply
cd ~/MagicMirror/modules/MMM-CalendarWeek
git pull
cd ~/MagicMirror/modules/MMM-OpenmapWeather
git pull
cd ~/MagicMirror/modules/MMM-Wallpaper
git pull
cdMy questions are :
1 - do I have to run a “git reset --hard” at all prior to running the update-script.sh script?
2 - if I have also configured the updatenotification module for those listed 3x modules, do I have to perform the “git pull” command in my own script if the command for those modules is specified?
{
module: “updatenotification”,
position: “bottom_bar”, //#position: “top_bar”,
config: {
updateInterval: 600000, // must be greater than 60000 (1 minute)
ignoreModules: [], // [“MMM=ExampleModule1”, “MMM-ExampleModule2”]
updateTimeout: 120000, // 2 minutes
updateAutorestart: true, // true, false
updates: [
{
“MMM-Wallpaper”: “git pull”,
},
{
“MMM-OpenmapWeather”: “git pull”,
},
{
“MMM-CalendarWeek”: “git pull”,
},
],
},
},Thanks.
-
@DarrenO-0 reset hard is dangerous. it wipes any changes you might have made, without recovery. if you KNOW you are OK, then it’s OK.
this is why my upgrade is 2 passes.
test , discover anything you might have forgotten, optionally save them (git stash)updatenotification just tells you that something is downlevel. YOU have to fix it.
git pull may not be enough. -
@sdetweil Thanks Sam
I’ve removed the git reset --hard from my .sh script
I had some small changes (gap-body-top/right/bottom/left set to 10px) in main.css which were reset back to the default 60px when I ran the git reset --hard command, so added those line specifically in the custom.css file instead and left the default vaules in the main.css file.For the updatenotification module, does the git pull command, for the respective specified modules not work?
I thought having a git pull command for the modules would negate the need to update them rather than have something display. I’m happy for the core MM update notification but didn’t want notifications for installed modules.
Am I, instead better off updating them as per the .sh script above?One last thing, when I update the config.js file, MM would normally auto-restart with file being rewritten.
Now, for some reason, it doesn’t. How can I get it to do so? -
@DarrenO-0
git reset
yes… AND you are NOT supposed to update our files… for this very problem. so it taught you something!.. my upgrade script would have warned you…update notification,… well it depends on the module and what the changes are
if the module has a package.json, then its git pull && npm install or npm rebuild, or …
altho the new 3rd party list is demanding a package.json for metadata about the module… so, that rule is not as useful…so it depends… I would NEVER allow an extension to update my system like that !..
so you get what you get… if it works, don’t touch it…on the restart on change, thats in pm2, and sometimes the file change detection doesn’t work … (for me like 95% not working… 5% where it works is on a mac, I rarely use for MM)…
pm2 restart all will do the same thing