Permalink
Browse files

Fix compilation when using a simple watch expression. (Closes #11)

Set the output directory to the current working directory when
no `:input` or `:output` option is provided, or the watcher regexp
contains no match group.
  • Loading branch information...
1 parent 7a0273b commit 27abed8e430a222c7d4d48f631341abf913e6fdf @netzpirat netzpirat committed Mar 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/guard/coffeescript/runner.rb
@@ -133,7 +133,7 @@ def detect_nested_directories(watchers, files, options)
watchers.product(files).each do |watcher, file|
if matches = file.match(watcher.pattern)
- target = matches[1] ? File.join(options[:output], File.dirname(matches[1])).gsub(/\/\.$/, '') : options[:output]
+ target = matches[1] ? File.join(options[:output], File.dirname(matches[1])).gsub(/\/\.$/, '') : options[:output] || '.'
if directories[target]
directories[target] << file
else

0 comments on commit 27abed8

Please sign in to comment.