Explorar el Código

Поправлен баг

Book Pauk hace 2 años
padre
commit
4817123599
Se han modificado 2 ficheros con 15 adiciones y 6 borrados
  1. 9 0
      server/createWebApp.js
  2. 6 6
      server/index.js

+ 9 - 0
server/createWebApp.js

@@ -41,4 +41,13 @@ module.exports = async(config) => {
 
     await fs.writeFile(verFile, config.version);
     await fs.remove(zipFile);
+
+    //rename app_new
+    const webAppDir = `${config.publicDir}/app`;
+    const appNewDir = `${config.publicDir}/app_new`;
+    if (await fs.pathExists(appNewDir)) {
+        await fs.remove(webAppDir);
+        await fs.move(appNewDir, webAppDir);
+    }
+
 };

+ 6 - 6
server/index.js

@@ -57,12 +57,6 @@ async function init() {
     await appLogger.init(config);
     log = appLogger.log;
 
-    //web app
-    if (branch !== 'development') {
-        const createWebApp = require('./createWebApp');
-        await createWebApp(config);
-    }
-
     //cli
     if (argv.help) {
         showHelp();
@@ -116,6 +110,12 @@ async function init() {
     config.recreateDb = argv.recreate || false;
     config.inpxFilterFile = `${config.execDir}/inpx-web-filter.json`;
     config.allowUnsafeFilter = argv['unsafe-filter'] || false;
+
+    //web app
+    if (branch !== 'development') {
+        const createWebApp = require('./createWebApp');
+        await createWebApp(config);
+    }
 }
 
 async function main() {