lib/tetra/script_generator.rb in tetra-0.42.0 vs lib/tetra/script_generator.rb in tetra-0.43.0
- old
+ new
@@ -23,10 +23,11 @@
.take_while { |e| e.match(/tetra +finish/).nil? }
.select { |e| e.match(/^#/).nil? }
script_lines = [
"#!/bin/bash",
+ "set -xe",
"PROJECT_PREFIX=`readlink -e .`",
"cd #{@project.latest_dry_run_directory}"
] +
relevant_lines.map do |line|
if line =~ /tetra +mvn/
@@ -42,13 +43,16 @@
result_path = File.join("src", "build.sh")
conflict_count = @project.merge_new_content(new_content, result_path, "Build script generated",
"generate_build_script")
- destination_script_path = File.join("output", @project.name, "build.sh")
+ output_dir = File.join("output", @project.name)
+ FileUtils.mkdir_p(output_dir)
+
+ destination_script_path = File.join(output_dir, "build.sh")
FileUtils.symlink(File.expand_path(result_path), destination_script_path, force: true)
- [result_path, conflict_count]
+ [destination_script_path, conflict_count]
end
end
end
end