diff --git a/index.js b/index.js index e638668..73c0888 100755 --- a/index.js +++ b/index.js @@ -154,11 +154,19 @@ function startWatching(opts) { // XXX: commands might be still run concurrently if (opts.command) { - debouncedRun( - opts.command - .replace(/\{path\}/ig, path) - .replace(/\{event\}/ig, event) - ); + if (opts.debounce > 0) { + debouncedRun( + opts.command + .replace(/\{path\}/ig, path) + .replace(/\{event\}/ig, event) + ); + } else { + throttledRun( + opts.command + .replace(/\{path\}/ig, path) + .replace(/\{event\}/ig, event) + ); + } } });