lib/jenkinson/api.rb in jenkinson-0.0.3 vs lib/jenkinson/api.rb in jenkinson-0.0.4
- old
+ new
@@ -20,9 +20,13 @@
def get_jobs_config(target_dir)
client.job.list_all.each do |jobname|
job_on_server = client.job.get_config(jobname) rescue nil
job = "#{target_dir}/#{jobname}/config.xml"
next if job_on_server.nil?
+
+ dirname = File.dirname(job)
+ Dir.mkdir(dirname) unless Dir.exist?(dirname)
+
File.open(job, "w") do |xml_file|
xml_file << job_on_server
end
end
end