Skip to content

Commit 816dd3f

Browse files
committed
Update debug.js (added missing configs/ directory).
1 parent 854a2ab commit 816dd3f

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

helpers/debug-raw.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ const options = {};
1717
const isDebugging = process.argv.indexOf('debugging') !== -1;
1818
const directory = process.cwd();
1919
const path = require('path');
20-
const VERSION = '7.0';
20+
const VERSION = '8.0';
2121
const TIME = 2000;
22+
const REG_CONFIGS = /configs\//g;
2223
const REG_FILES = /config\-debug|config\-release|config|versions|sitemap|dependencies|\.js|\.resource/i;
2324
const REG_THEMES = /\/themes\//i;
2425
const REG_COMPONENTS = /components\/.*?\.html/i;
@@ -58,9 +59,10 @@ function debug() {
5859
function app() {
5960
const fork = require('child_process').fork;
6061
const utils = require('total.js/utils');
61-
const directories = [directory + '/components', directory + '/controllers', directory + '/definitions', directory + '/isomorphic', directory + '/modules', directory + '/resources', directory + '/models', directory + '/source', directory + '/workers', directory + '/packages', directory + '/themes'];
62+
const directories = [directory + '/components', directory + '/controllers', directory + '/definitions', directory + '/isomorphic', directory + '/modules', directory + '/resources', directory + '/models', directory + '/source', directory + '/workers', directory + '/packages', directory + '/themes', directory + '/configs'];
6263
const async = new utils.Async();
6364
const prefix = '---------------------------------> ';
65+
6466
var files = {};
6567
var force = false;
6668
var changes = [];
@@ -74,9 +76,7 @@ function app() {
7476
var speed = TIME;
7577

7678
function onFilter(path, isDirectory) {
77-
if (!isDirectory && REG_THEMES.test(path))
78-
return REG_THEMES_INDEX.test(path);
79-
return isDirectory ? true : REG_EXTENSION.test(path) || REG_COMPONENTS.test(path);
79+
return !isDirectory && REG_THEMES.test(path) ? REG_THEMES_INDEX.test(path) : isDirectory ? true : REG_EXTENSION.test(path) || REG_COMPONENTS.test(path) || REG_CONFIGS.test(path);
8080
}
8181

8282
function onIncrease(clear) {
@@ -252,6 +252,7 @@ function app() {
252252
function noop() {}
253253

254254
if (process.pid > 0) {
255+
255256
console.log(prefix + 'PID: ' + process.pid + ' (v' + VERSION + ')');
256257
pid = path.join(directory, 'debug.pid');
257258
fs.writeFileSync(pid, process.pid);
@@ -287,13 +288,11 @@ function run() {
287288
}
288289

289290
var filename = path.join(directory, 'debug.pid');
290-
if (!fs.existsSync(filename)) {
291+
if (fs.existsSync(filename)) {
292+
fs.unlinkSync(filename);
293+
setTimeout(function() { app() }, 3000);
294+
} else
291295
app();
292-
return;
293-
}
294-
295-
fs.unlinkSync(filename);
296-
setTimeout(function() { app() }, 3000);
297296
}
298297

299298
run();

helpers/debug.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)