Updates notification (#3119)

Hi,

Like some default modules, I propose to send an `UPDATES` notification
in an array with the git information of these modules

This allows developers to create their own auto-update system (which
I've been using in my case since 3 years, with automatic things)

Of course, for security reasons `MagicMirror` is excluded

---------

Co-authored-by: bugsounet <bugsounet@bugsounet.fr>
This commit is contained in:
Bugsounet - Cédric
2023-06-08 22:41:48 +02:00
committed by GitHub
parent b7371538bc
commit e985e99036
4 changed files with 36 additions and 6 deletions

View File

@@ -44,6 +44,11 @@ module.exports = NodeHelper.create({
this.sendSocketNotification("STATUS", repo);
}
if (this.config.sendUpdatesNotifications) {
const updates = await this.gitHelper.checkUpdates();
if (updates.length) this.sendSocketNotification("UPDATES", updates);
}
this.scheduleNextFetch(this.config.updateInterval);
},