Class: GitHelper::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/git_helper/setup.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/git_helper/setup.rb', line 3

def execute
  if config_file_exists?
    answer = highline.ask_yes_no("It looks like the #{config_file} file already exists. Do you wish to replace it? (y/n)")
    puts
  else
    answer = true
  end

  create_or_update_config_file if answer

  answer = highline.ask_yes_no("Do you wish to set up the Git Helper plugins? (y/n)")

  if answer
    create_or_update_plugin_files
    puts "\nNow add this line to your ~/.bash_profile:\n  export PATH=/path/to/computer/home/.git_helper/plugins:$PATH"
    puts "\nDone!"
  end
end