lib/sunzi/cli.rb in sunzi-0.5.0 vs lib/sunzi/cli.rb in sunzi-0.5.1

- old
+ new

@@ -35,14 +35,11 @@ def self.source_root File.expand_path('../../',__FILE__) end def do_create(project) - empty_directory project - empty_directory "#{project}/recipes" - empty_directory "#{project}/roles" - # template "templates/create/.gitignore", "#{project}/.gitignore" + template "templates/create/.gitignore", "#{project}/.gitignore" template "templates/create/sunzi.yml", "#{project}/sunzi.yml" template "templates/create/install.sh", "#{project}/install.sh" template "templates/create/recipes/ssh_key.sh", "#{project}/recipes/ssh_key.sh" template "templates/create/roles/app.sh", "#{project}/roles/app.sh" template "templates/create/roles/db.sh", "#{project}/roles/db.sh" @@ -75,15 +72,15 @@ Open3.popen3(local_commands) do |stdin, stdout, stderr| stdin.close t = Thread.new do while (line = stderr.gets) - print line.color(:red).bright + print line.color(:red) end end while (line = stdout.gets) - print line.color(:green).bright + print line.color(:green) end t.join end end @@ -93,13 +90,9 @@ # Check if role exists abort_with "#{role} doesn't exist!" if role and !File.exists?("roles/#{role}.sh") # Load sunzi.yml hash = YAML.load(File.read('sunzi.yml')) - empty_directory 'compiled' - empty_directory 'compiled/attributes' - empty_directory 'compiled/recipes' - empty_directory 'compiled/files' # Break down attributes into individual files hash['attributes'].each {|key, value| create_file "compiled/attributes/#{key}", value } # Retrieve remote recipes via HTTP