Class: Pulsar::InitCommand

Inherits:
UtilsCommand show all
Defined in:
lib/pulsar/commands/init.rb

Instance Method Summary collapse

Methods included from Options::Shared

included

Methods included from Helpers::Clamp

included

Methods included from Helpers::Path

#capfile_path, #config_app_defaults_path, #config_app_path, #config_app_recipes_path, #config_app_stage_recipes_path, #config_apps_path, #config_base_path, #config_path, #config_stage_path

Methods included from Helpers::Shell

#cd, #rm_rf, #run_cmd, #touch

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pulsar/commands/init.rb', line 5

def execute
  Bundler.with_clean_env do
    destination_path = File.expand_path(configuration_path)

    pulsar_cmd_path = File.expand_path(File.dirname(__FILE__))
    init_repo_path = "#{pulsar_cmd_path}/../generators/init_repo"

    init_repo_path += "/*" if File.directory?(destination_path)

    run_cmd("cp -r #{init_repo_path} #{destination_path}", :verbose => verbose?)

    puts "Your starter configuration repo is in #{destination_path.yellow}."
    puts "Remember to run #{ "bundle install".red } to add the needed Gemfile.lock."
  end
end