Class: Completely::Commands::Install

Inherits:
Base
  • Object
show all
Defined in:
lib/completely/commands/install.rb

Constant Summary collapse

TARGETS =
%W[
  /usr/share/bash-completion/completions
  /usr/local/etc/bash_completion.d
  #{Dir.home}/.bash_completion.d
]

Instance Method Summary collapse

Methods inherited from Base

environment_config_path, environment_debug, option_function, param_config_path

Instance Method Details

#runObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/completely/commands/install.rb', line 31

def run
  bounce

  if args['--dry']
    puts command.join ' '
    return
  end

  success = system(*command)
  raise "Failed running command:\nnb`#{command.join ' '}`" unless success

  say "Saved m`#{target_path}`"
  say 'You may need to restart your session to test it'
end