Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const watchChecks = () => {
// Watch the path with the change listener and completion callback
return watchr.open(watchPath, listener, next)
}
p.then(() => {
console.log('===================================================================');
console.log('Started watching files in:');
console.log(' - ', CONTENTS_PATH);
console.log(' - ', API_SOURCE_PATH);
console.log('Doc gen will run when you change a file in either of these folders.');
console.log('===================================================================');
watchr.open(CONTENTS_PATH, listener, next);
watchr.open(API_SOURCE_PATH, listener, next);
});
p.then(() => {
console.log('===================================================================');
console.log('Started watching files in:');
console.log(' - ', CONTENTS_PATH);
console.log(' - ', API_SOURCE_PATH);
console.log('Doc gen will run when you change a file in either of these folders.');
console.log('===================================================================');
watchr.open(CONTENTS_PATH, listener, next);
watchr.open(API_SOURCE_PATH, listener, next);
});
return new Promise((resolve, reject) => {
const stalker = watchr.open(path, listener, function(err) {
console.log("lolwat", err);
if (err) return reject(err);
console.log("watch successful on", path);
resolve();
});
});
[].concat(files).forEach((file) => {
watchr.open(file, (changeType) => {
if (changeType === 'update') {
callback(file);
}
}, (err) => {
if (err && err.code !== 'ENOENT') {
throw err;
}
});
});
}