lib/aws_ec2/compile_scripts.rb in aws-ec2-0.4.0 vs lib/aws_ec2/compile_scripts.rb in aws-ec2-0.5.0

- old
+ new

@@ -8,20 +8,24 @@ def initialize(options) @options = options end def compile - puts "Compiling app/scripts to..." clean - Dir.glob("#{AwsEc2.root}/app/scripts/**/*").each do |path| + compile_folder("scripts") + compile_folder("user-data") + end + + def compile_folder(folder) + puts "Compiling app/#{folder}:" + Dir.glob("#{AwsEc2.root}/app/#{folder}/**/*").each do |path| next if File.directory?(path) result = erb_result(path) tmp_path = path.sub(%r{.*/app/}, "#{BUILD_ROOT}/app/") puts " #{tmp_path}" FileUtils.mkdir_p(File.dirname(tmp_path)) IO.write(tmp_path, result) end - puts "Compiled app/scripts." end def clean FileUtils.rm_rf(BUILD_ROOT) end