Skip to content

Commit

Permalink
Actually use the target dir
Browse files Browse the repository at this point in the history
  • Loading branch information
iain committed Jan 26, 2011
1 parent b9b8b58 commit bca51d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions thor.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def source
end end


def target def target
root.join(SOURCE) root.join(TARGET)
end end


def process_loose_file(file) def process_loose_file(file)
Expand All @@ -71,7 +71,7 @@ def process_directory(dir)
_compile( _compile(
command: "coffee -o tmp --join --compile src/#{dir}/**/*.coffee", command: "coffee -o tmp --join --compile src/#{dir}/**/*.coffee",
source: "tmp/concatenation.js", source: "tmp/concatenation.js",
target: dir.to_s + '.js', target: target.join(dir.to_s + '.js'),
message: "\e[032mcompiled\e[0;90m '\e[0m%{target}\e[0;90m'\e[0m" message: "\e[032mcompiled\e[0;90m '\e[0m%{target}\e[0;90m'\e[0m"
) )
end end
Expand All @@ -85,7 +85,8 @@ def _compile(args = {})
end end
stderr = stderr.read stderr = stderr.read
if stderr == "" if stderr == ""
system "mv #{args[:source]} #{args[:target]}" mv = [ "mv", args[:source], args[:target] ].map(&:to_s)
system *mv
msg = args[:message] % args msg = args[:message] % args
puts "\e[0;90m#{Time.now} #{msg}" puts "\e[0;90m#{Time.now} #{msg}"
notify false, "Success: #{File.basename(args[:target])}", msg.gsub(/\e\[[^m]+m/,'') notify false, "Success: #{File.basename(args[:target])}", msg.gsub(/\e\[[^m]+m/,'')
Expand Down

0 comments on commit bca51d5

Please sign in to comment.