mango-cms 0.2.8 → 0.2.10

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
@@ -422,26 +422,30 @@ async function configureWebServer(settings, buildPath) {
422
422
  `/etc/apache2/sites-available/${settings.siteName.toLowerCase()}.conf`;
423
423
 
424
424
  try {
425
- // Write config file
426
- fs.writeFileSync(configPath, config);
427
- console.log(`Created ${webServer} configuration at ${configPath}`);
428
-
429
- if (webServer === 'nginx') {
430
- // Create symlink if it doesn't exist
431
- const enabledPath = `/etc/nginx/sites-enabled/${settings.siteName.toLowerCase()}`;
432
- if (!fs.existsSync(enabledPath)) {
433
- execSync(`sudo ln -s ${configPath} ${enabledPath}`);
434
- }
435
- // Test and reload nginx
436
- execSync('sudo nginx -t');
437
- execSync('sudo systemctl reload nginx');
425
+ // Check if config already exists
426
+ if (fs.existsSync(configPath)) {
427
+ console.log(`${webServer} configuration already exists at ${configPath}, skipping creation`);
438
428
  } else {
439
- // Enable site and reload apache
440
- execSync(`sudo a2ensite ${settings.siteName.toLowerCase()}`);
441
- execSync('sudo systemctl reload apache2');
429
+ // Write config file only if it doesn't exist
430
+ fs.writeFileSync(configPath, config);
431
+ console.log(`Created ${webServer} configuration at ${configPath}`);
432
+
433
+ if (webServer === 'nginx') {
434
+ // Create symlink if it doesn't exist
435
+ const enabledPath = `/etc/nginx/sites-enabled/${settings.siteName.toLowerCase()}`;
436
+ if (!fs.existsSync(enabledPath)) {
437
+ execSync(`sudo ln -s ${configPath} ${enabledPath}`);
438
+ }
439
+ execSync('sudo nginx -t');
440
+ execSync('sudo systemctl reload nginx');
441
+ } else {
442
+ // Enable apache site
443
+ execSync(`sudo a2ensite ${settings.siteName.toLowerCase()}`);
444
+ execSync('sudo systemctl reload apache2');
445
+ }
446
+ console.log(`${webServer} configuration has been updated and service reloaded`);
442
447
  }
443
448
 
444
- console.log(`${webServer} configuration has been updated and service reloaded`);
445
449
  } catch (error) {
446
450
  console.error(`Error configuring ${webServer}:`, error.message);
447
451
  throw error;
@@ -2,7 +2,7 @@
2
2
  "name": "mango-front",
3
3
  "version": "0.0.0",
4
4
  "scripts": {
5
- "dev": "vite",
5
+ "dev": "VITE_DEVMODE=true vite",
6
6
  "build": "vite build",
7
7
  "preview": "vite preview",
8
8
  "mango": "mango"
@@ -15,7 +15,7 @@ import './index.css'
15
15
  */
16
16
 
17
17
  import Home from './components/pages/home.vue'
18
- const isDev = ['true', '1'].includes(import.meta.env.VITE_DEVMODE)
18
+ const isDev = import.meta.env.DEV
19
19
 
20
20
  const routes = [
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
6
  ".": "./index.js",