27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/mini_deploy/cli.rb', line 27
def install
puts "Create sample config and receipt file. "
sample_file = SampleFile.new
[ './config/', './receipts/' ].each do |dir_path|
if Dir.exist?(dir_path)
puts "* #{dir_path} exists."
else
FileUtils.mkdir_p(dir_path)
puts "* #{dir_path} created."
end
end
sample_hosts_default_path = './config/sample_hosts.yml'
IO.write(sample_hosts_default_path, sample_file.hosts)
puts "* #{sample_hosts_default_path} create."
sample_receipt_default_path = './receipts/sample.yml'
IO.write(sample_receipt_default_path, sample_file.receipt)
puts "* #{sample_receipt_default_path} create."
end
|