failover nsfw to gulp-watch

This commit is contained in:
Joao Moreno 2017-06-27 10:48:18 +02:00
parent 7cbb52aae3
commit 11e3f1bfc4

View file

@ -17,13 +17,19 @@ function handleDeletions() {
});
}
const useLegacyWatch = process.env['VSCODE_USE_LEGACY_WATCH'];
let watch = void 0;
const watch = !useLegacyWatch ?
require('./watch-nsfw')
: process.platform === 'win32'
? require('./watch-win32')
: require('gulp-watch');
if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
try {
watch = require('./watch-nsfw');
} catch (err) {
console.warn('Could not load NSFW watcher');
}
}
if (!watch) {
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
}
module.exports = function () {
return watch.apply(null, arguments)