Commits

Anonymous committed 6b4cba3

fix FS_MODULE_EXTERNAL

  • Participants
  • Parent commits 9f4270f

Comments (0)

Files changed (3)

       EXPORTS.MODULE_WATCH = EXPORTS.MODULE_WATCH || {};
       //// reload self
       if (!EXPORTS.MODULE_FILE.hasOwnProperty(module.filename)) {
-        EXPORTS.MODULE_FILE[module.filename] = true;
         EXPORTS.moduleLoad(module);
         return;
       }
         'externalRollup.css',
         'externalRollup.js',
       ].forEach(function (filename) {
-        if (EXPORTS.requireFs.existsSync(EXPORTS.FS_EXTERNAL + '/' + filename)) {
-          EXPORTS.MODULE_FILE['/public/cacheVersion/' + filename] = EXPORTS.requireFs.readFileSync(EXPORTS.FS_EXTERNAL + '/' + filename);
+        if (EXPORTS.requireFs.existsSync(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename)) {
+          EXPORTS.MODULE_FILE['/public/cacheVersion/' + filename] = EXPORTS.requireFs.readFileSync(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename);
         }
       });
       //// auto rollup
             try {
               if (err) { throw err; }
               console.assert(response.statusCode === 200, response.statusCode);
-              EXPORTS.requireFs.writeFileSync(EXPORTS.FS_EXTERNAL + '/' + filename, data);
+              EXPORTS.requireFs.writeFileSync(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename, data);
               delete obj[filename];
             } catch (errCallback) {
               console.log(errCallback.stack);
       [
         'imgAjaxLoader.gif'
       ].forEach(function (filename) {
-        css += '.' + (/\w+/).exec(filename) + ' { background: url(' + EXPORTS.externalDataUri(EXPORTS.FS_EXTERNAL + '/' + filename) + ') no-repeat center center;';
+        css += '.' + (/\w+/).exec(filename) + ' { background: url(' + EXPORTS.externalDataUri(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename) + ') no-repeat center center;';
       });
-      EXPORTS.requireFs.writeFileSync(EXPORTS.FS_EXTERNAL + '/externalRollup.css', css);
-      EXPORTS.requireFs.writeFileSync(EXPORTS.FS_EXTERNAL + '/externalRollup.js', js);
+      EXPORTS.requireFs.writeFileSync(EXPORTS.FS_MODULE_EXTERNAL + '/externalRollup.css', css);
+      EXPORTS.requireFs.writeFileSync(EXPORTS.FS_MODULE_EXTERNAL + '/externalRollup.js', js);
     },
 
     _externalRollupFile: function (filename) {
-      var data = EXPORTS.requireFs.readFileSync(EXPORTS.FS_EXTERNAL + '/' + filename, 'utf8') + '\n';
+      var data = EXPORTS.requireFs.readFileSync(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename, 'utf8') + '\n';
       switch (filename) {
       case 'bootstrap.css':
         data = data.replace(/"\.\.\/img\/(.+)"/g, function (_, filename) {
-          return EXPORTS.externalDataUri(EXPORTS.FS_EXTERNAL + '/bootstrap.' + filename);
+          return EXPORTS.externalDataUri(EXPORTS.FS_MODULE_EXTERNAL + '/bootstrap.' + filename);
         });
         break;
       case 'datatables.css':
         data = data.replace(/'\.\.\/images\/(.+)'/g, function (_, filename) {
-          return EXPORTS.externalDataUri(EXPORTS.FS_EXTERNAL + '/datatables.' + filename);
+          return EXPORTS.externalDataUri(EXPORTS.FS_MODULE_EXTERNAL + '/datatables.' + filename);
         });
         break;
       case 'select2.css':
         data = data.replace(/'(\w+\.png)'/g, function (_, filename) {
-          return EXPORTS.externalDataUri(EXPORTS.FS_EXTERNAL + '/' + filename);
+          return EXPORTS.externalDataUri(EXPORTS.FS_MODULE_EXTERNAL + '/' + filename);
         });
         break;
       }
       //// start application
       if (EXPORTS.startApp) { EXPORTS.startApp(); }
       //// main command-line code
-      if (!EXPORTS.IS_CLI) { return; }
-      Object.keys(EXPORTS.ARGV).forEach(function (key) {
-        var val = EXPORTS.ARGV[key];
-        if (!val) { return; }
-        switch (key) {
-        case 'rollup':
-          EXPORTS.externalRollup();
-          EXPORTS.EXIT = true;
-          break;
-        }
-      });
-      if (EXPORTS.EXIT) { process.exit(); }
-      //// start interactive debugger
-      EXPORTS.startRepl();
-      //// start http server if port exists
-      EXPORTS.startServer();
+      if (EXPORTS.IS_CLI) {
+        Object.keys(EXPORTS.ARGV).forEach(function (key) {
+          var val = EXPORTS.ARGV[key];
+          if (!val) { return; }
+          switch (key) {
+          case 'rollup':
+            EXPORTS.externalRollup();
+            EXPORTS.EXIT = true;
+            break;
+          }
+        });
+        if (EXPORTS.EXIT) { process.exit(); }
+        //// start interactive debugger
+        EXPORTS.startRepl();
+        //// start http server if port exists
+        EXPORTS.startServer();
+      }
     }
 
   };
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
   },
-  "version": "2013.03.19-18.50.09"
+  "version": "2013.03.20-01.22.12"
 }