[UpdateNotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)

I discover this bug:

When pm2 `sh` script is on MagicMirror root folder, updatenotification
is not able to detect pm2 using

```
0|MagicMirror  | [2024-10-02 17:23:09.215] [DEBUG]   Version Compare: 2.30.0-develop 2.30.0-develop --> true 
0|MagicMirror  | [2024-10-02 17:23:09.216] [DEBUG]   Status: online 
0|MagicMirror  | [2024-10-02 17:23:09.216] [DEBUG]   PM2 MagicMirror starting  from Path: /home/bugsounet/MagicMirror-dev 
0|MagicMirror  | [2024-10-02 17:23:09.216] [DEBUG]   MagicMirror Path /home/bugsounet/MagicMirror-dev/
0|MagicMirror  | [2024-10-02 17:23:09.216] [DEBUG]   Compare: false
0|MagicMirror  | [2024-10-02 17:23:09.216] [INFO]  updatenotification: [PM2] You are not using pm2 
```
This commit is contained in:
Bugsounet - Cédric 2024-10-02 18:33:46 +02:00 committed by GitHub
parent 4c7c859ae6
commit ee98a0c7e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,8 @@ _This release is scheduled to be released on 2025-01-01._
### Fixed ### Fixed
- [updatenotification] Fix pm2 using detection when pm2 script is in MagicMirror root folder (#3576)
## [2.29.0] - 2024-10-01 ## [2.29.0] - 2024-10-01
Thanks to: @bugsounet, @dkallen78, @jargordon, @khassel, @KristjanESPERANTO, @MarcLandis, @rejas, @ryan-d-williams, @sdetweil, @skpanagiotis. Thanks to: @bugsounet, @dkallen78, @jargordon, @khassel, @KristjanESPERANTO, @MarcLandis, @rejas, @ryan-d-williams, @sdetweil, @skpanagiotis.

View File

@ -187,7 +187,7 @@ class Updater {
return; return;
} }
list.forEach((pm) => { list.forEach((pm) => {
if (pm.pm2_env.version === this.version && pm.pm2_env.status === "online" && pm.pm2_env.pm_cwd.includes(`${this.root_path}/`)) { if (pm.pm2_env.version === this.version && pm.pm2_env.status === "online" && pm.pm2_env.pm_cwd.includes(`${this.root_path}`)) {
this.PM2 = pm.name; this.PM2 = pm.name;
this.usePM2 = true; this.usePM2 = true;
Log.info("updatenotification: [PM2] You are using pm2 with", this.PM2); Log.info("updatenotification: [PM2] You are using pm2 with", this.PM2);