lib/new/cli.rb in new-0.0.11 vs lib/new/cli.rb in new-0.0.12
- old
+ new
@@ -32,23 +32,22 @@
desc 'init', 'Set up your home directory folder for storing custom templates and default configuration'
def init
if Dir.exists? New::CUSTOM_DIR
New.say 'Home folder already exists.', type: :warn
else
- # create folder
+ # create folders
New.say 'Creating home folder.', type: :success
- FileUtils.mkdir_p New::CUSTOM_DIR
FileUtils.mkdir_p File.join(New::CUSTOM_DIR, New::TASKS_DIR_NAME)
FileUtils.mkdir_p File.join(New::CUSTOM_DIR, New::TEMPLATES_DIR_NAME)
# create config file
New.say 'Creating default configuration file.', type: :success
File.open File.join(New::CUSTOM_DIR, New::CONFIG_FILE), 'w' do |f|
- f.write New::Template::CUSTOM_CONFIG_TEMPLATE.to_yaml
+ f.write New::Template::CUSTOM_CONFIG_TEMPLATE.deep_stringify_keys.to_yaml
end
- New.say "Edit #{File.join(New::CUSTOM_DIR, New::CONFIG_FILE)} with your custom configuration details.", type: :warn
+ New.say "Edit `#{File.join(New::CUSTOM_DIR, New::CONFIG_FILE)}` with your custom configuration details.", type: :warn
end
end
desc 'release', 'Release your new code (Run from within a project directory!)'
def release
@@ -71,9 +70,10 @@
end
rescue LoadError
New.say "No task '#{task}' found!", type: :fail
next
end
+ New.say ">>> Initializing #{task.to_s.humanize} Task...", type: :warn
"New::Task::#{task.to_s.classify}".constantize.new project_config
end
end
private