11// ===================================================
22// IMPORTANT: only for development
3- // total .js - web application framework for node .js
4- // http ://www.totaljs.com
3+ // Total .js - framework for Node .js
4+ // https ://www.totaljs.com
55// ===================================================
66
77const fs = require ( 'fs' ) ;
88const options = { } ;
99
1010// options.ip = '127.0.0.1';
1111// options.port = parseInt(process.argv[2]);
12- // options.config = { name: 'total .js' };
12+ // options.config = { name: 'Total .js' };
1313// options.https = { key: fs.readFileSync('keys/agent2-key.pem'), cert: fs.readFileSync('keys/agent2-cert.pem')};
1414// options.sleep = 3000;
1515// options.debugger = 40894;
@@ -108,7 +108,7 @@ function app() {
108108
109109 for ( var i = 0 ; i < length ; i ++ ) {
110110 var name = f [ i ] ;
111- if ( ! files [ name ] )
111+ if ( files [ name ] === undefined )
112112 files [ name ] = isLoaded ? 0 : null ;
113113 }
114114
@@ -127,16 +127,16 @@ function app() {
127127 async . await ( function ( next ) {
128128 fs . stat ( filename , function ( err , stat ) {
129129
130- var stamp = '--- ' + new Date ( ) . format ( 'yyyy-MM-dd- HH:mm:ss' ) + ' ' ;
130+ var stamp = '--- # --- [ ' + new Date ( ) . format ( 'yyyy-MM-dd HH:mm:ss' ) + ' ] ' ;
131131
132132 if ( err ) {
133133 delete files [ filename ] ;
134- changes . push ( stamp + prefix + filename . replace ( directory , '' ) + ' (removed)' ) ;
134+ changes . push ( stamp . replace ( '#' , 'REM' ) + prefix + filename . replace ( directory , '' ) ) ;
135135 force = true ;
136136 } else {
137137 var ticks = stat . mtime . getTime ( ) ;
138- if ( files [ filename ] && files [ filename ] !== ticks ) {
139- changes . push ( stamp + prefix + filename . replace ( directory , '' ) + ( files [ filename ] === 0 ? ' (added) ' : ' (modified) ' ) ) ;
138+ if ( files [ filename ] != null && files [ filename ] !== ticks ) {
139+ changes . push ( stamp . replace ( '#' , files [ filename ] === 0 ? 'ADD ' : 'UPD' ) + prefix + filename . replace ( directory , ' ') ) ;
140140 force = true ;
141141 }
142142 files [ filename ] = ticks ;
0 commit comments