mirror of https://github.com/BTCPrivate/z-nomp.git
Update website.js
Added support for older node-watch versions, prior to 0.5.0
This commit is contained in:
parent
3062f5ae9e
commit
d53e6db63a
|
@ -98,7 +98,13 @@ module.exports = function(logger){
|
||||||
// if an html file was changed reload it
|
// if an html file was changed reload it
|
||||||
/* requires node-watch 0.5.0 or newer */
|
/* requires node-watch 0.5.0 or newer */
|
||||||
watch(['./website', './website/pages'], function(evt, filename){
|
watch(['./website', './website/pages'], function(evt, filename){
|
||||||
var basename = path.basename(filename);
|
var basename;
|
||||||
|
// support older versions of node-watch automatically
|
||||||
|
if (!filename && evt)
|
||||||
|
basename = path.basename(evt);
|
||||||
|
else
|
||||||
|
basename = path.basename(filename);
|
||||||
|
|
||||||
if (basename in pageFiles){
|
if (basename in pageFiles){
|
||||||
readPageFiles([basename]);
|
readPageFiles([basename]);
|
||||||
logger.special(logSystem, 'Server', 'Reloaded file ' + basename);
|
logger.special(logSystem, 'Server', 'Reloaded file ' + basename);
|
||||||
|
|
Loading…
Reference in New Issue