Comparing version 0.0.1 to 0.0.2
@@ -13,3 +13,3 @@ (function() { | ||
module.exports = (program) => { | ||
var close, connections, entry, k, ref, ref1, restart, server, startup, unwatchedModules, v, watcher; | ||
var busy, close, connections, entry, k, ref, ref1, restart, server, startup, unwatchedModules, v, watcher; | ||
if (((ref = program.args) != null ? ref[0] : void 0) == null) { | ||
@@ -31,2 +31,3 @@ return; | ||
watcher = null; | ||
busy = false; | ||
unwatchedModules = []; | ||
@@ -61,5 +62,8 @@ ref1 = require.cache; | ||
if (watcher == null) { | ||
return watcher = chokidar.watch(filesToWatch, { | ||
watcher = chokidar.watch(filesToWatch, { | ||
ignoreInitial: true | ||
}).on("all", (e, filepath) => { | ||
if (busy) { | ||
return; | ||
} | ||
uncache(filepath, __filename); | ||
@@ -69,4 +73,5 @@ return restart(); | ||
} else { | ||
return watcher.add(filesToWatch); | ||
watcher.add(filesToWatch); | ||
} | ||
return busy = false; | ||
}; | ||
@@ -76,2 +81,6 @@ startup(false); | ||
var con, i, len; | ||
if (busy) { | ||
return; | ||
} | ||
busy = true; | ||
if (typeof close === "function") { | ||
@@ -78,0 +87,0 @@ close(); |
{ | ||
"name": "autodev", | ||
"description": "recursively uncache required files", | ||
"version": "0.0.1", | ||
"description": "quick auto restart script for dev servers", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/paulpflug/", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4661
106