Skip to content

Commit

Permalink
Fix compilation when using a simple watch expression. (Closes #11)
Browse files Browse the repository at this point in the history
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
netzpirat committed Mar 13, 2012
1 parent 7a0273b commit 27abed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/guard/coffeescript/runner.rb
Expand Up @@ -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
Expand Down

0 comments on commit 27abed8

Please sign in to comment.