@@ -17,8 +17,9 @@ const options = {};
1717const isDebugging = process . argv . indexOf ( 'debugging' ) !== - 1 ;
1818const directory = process . cwd ( ) ;
1919const path = require ( 'path' ) ;
20- const VERSION = '7 .0' ;
20+ const VERSION = '8 .0' ;
2121const TIME = 2000 ;
22+ const REG_CONFIGS = / c o n f i g s \/ / g;
2223const REG_FILES = / c o n f i g \- d e b u g | c o n f i g \- r e l e a s e | c o n f i g | v e r s i o n s | s i t e m a p | d e p e n d e n c i e s | \. j s | \. r e s o u r c e / i;
2324const REG_THEMES = / \/ t h e m e s \/ / i;
2425const REG_COMPONENTS = / c o m p o n e n t s \/ .* ?\. h t m l / i;
@@ -58,9 +59,10 @@ function debug() {
5859function 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
299298run ( ) ;
0 commit comments