node-open-mining-portal
node-open-mining-portal copied to clipboard
Fix node-watch warning
zone117x/node-open-mining-portal#649
(node:4020) DeprecationWarning: (node-watch) First param in callback function is replaced with event name since 0.5.0, use (evt, filename) => {} if you want to get the filename
@streetcrypto7

Hi, your reference was z-nomp. Its already well known source. You are not invented.
https://github.com/z-classic/z-nomp/blob/104dcf33f649090c2dd6acda6b4aa37ea68c8f55/libs/website.js#L100
// if an html file was changed reload it
/* requires node-watch 0.5.0 or newer */
watch(['./website', './website/pages'], function(evt, 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){
readPageFiles([basename]);
logger.special(logSystem, 'Server', 'Reloaded file ' + basename);
}
});
But since its not matched well with current NOMP#dev, and I suggested some changes, but you did not. So I made a new PR to dev branch.

I cannot steal your commit, and your opinion is totally nonsense. Whats your problem?
@streetcrypto7 even your commit was not same as mine.

@streetcrypto7 thanks