bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
185 stars 54 forks source link

Module directory checking and updating #13

Closed topjor closed 5 years ago

topjor commented 6 years ago

After seeing a update message, I thought about updating my container and checked your repo first to see if it handled updating the default modules. Looking at this script, you are checking if /opt/magic_mirror/modules is a regular file, not a directory https://github.com/bastilimbach/docker-MagicMirror/blob/0d92ce00bbf014606ebf784bdf77a52c5124ef62/docker-entrypoint.sh#L3 This means every time the entry script is invoked it will copy over everything from /opt/default_modules/. This also does not account for files that are not present anymore in the defaults

I forked your repo to see if I could come up with a way of solving the issue, so far i have changed the check to see if the /opt/magic_mirror/modules/default folder exists and move all my modules in a sub folder, but that makes adding modules also more complicated, requiring the subdir in the name or compiling a js file that defines all modules like the default folder has (this would involve making a script to compile this file each boot).

Another idea was to store and check for a version file in the module directory to see if it needs updating.

What do you think would be a good idea to go about solving this?

bastilimbach commented 6 years ago

Thanks for reporting the issue. I'll take a look at this next week 👍