fastlane/lib/fastlane/junit_generator.rb in fastlane-2.48.0.beta.20170724010003 vs fastlane/lib/fastlane/junit_generator.rb in fastlane-2.48.0
- old
+ new
@@ -12,10 +12,15 @@
xml_path = File.join(Fastlane::ROOT, "lib/assets/report_template.xml.erb")
xml = ERB.new(File.read(xml_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system
xml = xml.gsub('system_', 'system-').delete("\e") # Jenkins can not parse 'ESC' symbol
- File.write(path, xml)
+ begin
+ File.write(path, xml)
+ rescue => ex
+ UI.error(ex)
+ UI.error("Couldn't save report.xml at path '#{File.expand_path(output_path)}', make sure you have write access to the containing directory.")
+ end
return path
end
end
end