Permalink
Browse files

Top level directories are empty, so make them simply absolute.

  • Loading branch information...
1 parent 2c9884d commit bb221f7f8810765bd0c8c0a3cf3d56694884dbb5 @netzpirat netzpirat committed Dec 15, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/guard/coffeescript/runner.rb
@@ -108,6 +108,7 @@ def options_for_file(file, options)
# @option options [Boolean] :noop do not generate an output file
#
def write_javascript_file(content, file, directory, options)
+ directory = Dir.pwd if !directory || directory.empty?
FileUtils.mkdir_p(File.expand_path(directory)) if !File.directory?(directory) && !options[:noop]
filename = File.join(directory, File.basename(file.gsub(/(js\.coffee|coffee)$/, 'js')))
File.open(File.expand_path(filename), 'w') { |f| f.write(content) } if !options[:noop]

0 comments on commit bb221f7

Please sign in to comment.