lib/caramelize/cli/create_command.rb in caramelize-0.2.0 vs lib/caramelize/cli/create_command.rb in caramelize-0.3.0
- old
+ new
@@ -1,7 +1,7 @@
-#Encoding: UTF-8
require 'caramelize/cli'
+require 'fileutils'
module Caramelize::CLI
# The CLI command for creating a caramelize config file.
class CreateCommand < CmdParse::Command
@@ -23,30 +23,14 @@
"Usage: #{commandparser.program_name} [global options] create [options]"
end
# Create a caramelize config file.
def execute(args)
- begin
-
- # create dummy config file
- target_file = @config_file.nil? ? "caramel.rb" : @config_file
-
-
- #puts args[0]
- require 'fileutils'
-
- FileUtils.cp(File.dirname(__FILE__) +"/../caramel.rb", target_file)
-
- rescue
- #require 'fileutils'
- #FileUtils.rm_rf(args[0])
- raise
- end
+ # create dummy config file
+ target_file = @config_file.nil? ? "caramel.rb" : @config_file
+ FileUtils.cp(File.dirname(__FILE__) +"/../caramel.rb", target_file)
if commandparser.verbosity == :normal
puts "Created new configuration file: #{target_file}"
- #puts paths.sort.join("\n")
end
end
-
end
-
end
\ No newline at end of file