mango-cms 0.2.18 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.js CHANGED
@@ -559,11 +559,12 @@ async function checkPM2() {
559
559
  // Helper function to manage PM2 process
560
560
  async function managePM2Process(settings) {
561
561
  const processName = `${settings.siteName.toLowerCase()}-mango`;
562
+ const name = settings.siteName.toLowerCase()
562
563
 
563
564
  try {
564
565
  // Check if process exists
565
566
  const processListOutput = execSync('pm2 list', { encoding: 'utf8' });
566
- const processExists = processListOutput.includes(processName);
567
+ let processExists = processListOutput.includes(processName);
567
568
 
568
569
  if (processExists) {
569
570
  console.log(`Reloading PM2 process: ${processName}`);
@@ -572,6 +573,17 @@ async function managePM2Process(settings) {
572
573
  console.log(`Starting new PM2 process: ${processName}`);
573
574
  execSync(`pm2 start index.js --name ${processName}`, { cwd: './build' });
574
575
  }
576
+
577
+ processExists = processListOutput.includes(name);
578
+
579
+ if (processExists) {
580
+ console.log(`Reloading PM2 process: ${name}`);
581
+ execSync(`pm2 reload ${name}`);
582
+ } else {
583
+ console.log(`Starting new PM2 process: ${name}`);
584
+ execSync(`pm2 start index.js --name ${name}`, { cwd: './dist' });
585
+ }
586
+
575
587
  } catch (error) {
576
588
  console.error('Error managing PM2 process:', error.message);
577
589
  throw error;
@@ -25,7 +25,7 @@
25
25
  "dayjs": "^1.10.7",
26
26
  "express": "^4.18.1",
27
27
  "google-maps": "^4.3.3",
28
- "mango-cms": "^0.2.2",
28
+ "mango-cms": "^0.2.20",
29
29
  "mapbox-gl": "^2.7.0",
30
30
  "sweetalert2": "^11.4.0",
31
31
  "vite": "^6.2.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
6
  ".": "./index.js",