small fix

This commit is contained in:
amartynov 2014-11-21 14:15:44 +03:00
parent 40942d9c79
commit 883e100004

View File

@ -19,14 +19,14 @@ else
raise "No config file '#{config_file}' found" raise "No config file '#{config_file}' found"
end end
config[:devops_home] = File.join(ENV["HOME"], ".devops") config[:devops_dir] = File.join(ENV["HOME"], ".devops") if config[:devops_dir].nil?
puts "Devops home: #{config[:devops_home]}" puts "Devops home: #{config[:devops_dir]}"
unless File.exists?(config[:devops_home]) unless File.exists?(config[:devops_dir])
FileUtils.mkdir config[:devops_home] FileUtils.mkdir_p config[:devops_dir]
puts "Directory '#{config[:devops_home]}' has been created" puts "Directory '#{config[:devops_dir]}' has been created"
end end
config[:report_dir_v2] = File.expand_path(File.join(config[:devops_home], "report", "v2")) unless config[:report_dir_v2] config[:report_dir_v2] = File.expand_path(File.join(config[:devops_dir], "report", "v2")) unless config[:report_dir_v2]
[ [
:report_dir_v2 :report_dir_v2
].each {|key| d = config[key]; FileUtils.mkdir_p(d) unless File.exists?(d) } ].each {|key| d = config[key]; FileUtils.mkdir_p(d) unless File.exists?(d) }