mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 05:08:41 -09:00
Replace chokidar by fs.watch (#2217)
This commit is contained in:
parent
97d1ae33d3
commit
bd5b16c7da
3 changed files with 16 additions and 979 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
const chokidar = require('chokidar');
|
const fs = require('fs');
|
||||||
const notify = require('./notify');
|
const notify = require('./notify');
|
||||||
const _import = require('./config/import');
|
const _import = require('./config/import');
|
||||||
const _openConfig = require('./config/open');
|
const _openConfig = require('./config/open');
|
||||||
|
|
@ -6,9 +6,6 @@ const win = require('./config/windows');
|
||||||
const {cfgPath, cfgDir} = require('./config/paths');
|
const {cfgPath, cfgDir} = require('./config/paths');
|
||||||
|
|
||||||
const watchers = [];
|
const watchers = [];
|
||||||
// watch for changes on config every 2s on windows
|
|
||||||
// https://github.com/zeit/hyper/pull/1772
|
|
||||||
const watchCfg = process.platform === 'win32' ? {interval: 2000} : {};
|
|
||||||
let cfg = {};
|
let cfg = {};
|
||||||
let _watcher;
|
let _watcher;
|
||||||
|
|
||||||
|
|
@ -17,7 +14,13 @@ const _watch = function () {
|
||||||
return _watcher;
|
return _watcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
_watcher = chokidar.watch(cfgPath, watchCfg);
|
if (process.platform === 'win32') {
|
||||||
|
// watch for changes on config every 2s on windows
|
||||||
|
// https://github.com/zeit/hyper/pull/1772
|
||||||
|
_watcher = fs.watchFile(cfgPath, {interval: 2000});
|
||||||
|
} else {
|
||||||
|
_watcher = fs.watch(cfgPath);
|
||||||
|
}
|
||||||
|
|
||||||
_watcher.on('change', () => {
|
_watcher.on('change', () => {
|
||||||
cfg = _import();
|
cfg = _import();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
"xo": false,
|
"xo": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async-retry": "1.1.3",
|
"async-retry": "1.1.3",
|
||||||
"chokidar": "1.7.0",
|
|
||||||
"color": "2.0.0",
|
"color": "2.0.0",
|
||||||
"convert-css-color-name-to-hex": "0.1.1",
|
"convert-css-color-name-to-hex": "0.1.1",
|
||||||
"default-shell": "1.0.1",
|
"default-shell": "1.0.1",
|
||||||
|
|
@ -21,6 +20,7 @@
|
||||||
"electron-squirrel-startup": "1.0.0",
|
"electron-squirrel-startup": "1.0.0",
|
||||||
"file-uri-to-path": "1.0.0",
|
"file-uri-to-path": "1.0.0",
|
||||||
"git-describe": "4.0.2",
|
"git-describe": "4.0.2",
|
||||||
|
"lodash": "4.17.4",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"ms": "2.0.0",
|
"ms": "2.0.0",
|
||||||
"node-fetch": "1.7.2",
|
"node-fetch": "1.7.2",
|
||||||
|
|
|
||||||
980
app/yarn.lock
980
app/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue