mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
fix fs stats.mtime usage in config.js
This commit is contained in:
parent
f684093e94
commit
36e08165d6
1 changed files with 2 additions and 2 deletions
|
|
@ -30,10 +30,10 @@ const _watch = () => {
|
||||||
// watch for changes on config every 2s on Windows
|
// watch for changes on config every 2s on Windows
|
||||||
// https://github.com/zeit/hyper/pull/1772
|
// https://github.com/zeit/hyper/pull/1772
|
||||||
_watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => {
|
_watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => {
|
||||||
if (curr.mtime === 0) {
|
if (!curr.mtime || curr.mtime.getTime() === 0) {
|
||||||
//eslint-disable-next-line no-console
|
//eslint-disable-next-line no-console
|
||||||
console.error('error watching config');
|
console.error('error watching config');
|
||||||
} else if (curr.mtime !== prev.mtime) {
|
} else if (curr.mtime.getTime() !== prev.mtime.getTime()) {
|
||||||
onChange();
|
onChange();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue