lib/planter/script.rb in planter-cli-3.0.4 vs lib/planter/script.rb in planter-cli-3.0.5

- old
+ new

@@ -12,16 +12,16 @@ ## @param output_dir [String] The planted template directory ## @param script [String] The script name ## def initialize(template_dir, output_dir, script) found = find_script(template_dir, script) - raise ScriptError.new("Script #{script} not found") unless found + die("Script #{script} not found", :script) unless found @script = found make_executable - raise ScriptError.new("Output directory #{output_dir} not found") unless File.directory?(output_dir) + die("Output directory #{output_dir} not found", :script) unless File.directory?(output_dir) @template_directory = template_dir @directory = output_dir end @@ -61,10 +61,10 @@ ## def run stdout, stderr, status = Open3.capture3(@script, @template_directory, @directory) Planter.notify("STDOUT:\n#{stdout}", :debug) unless stdout.empty? Planter.notify("STDERR:\n#{stderr}", :debug) unless stderr.empty? - raise ScriptError.new("Error running #{@script}") unless status.success? + die("Error running #{@script}", :script) unless status.success? true end end end