Class: Completely::Commands::Install

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

Instance Method Summary collapse

Methods inherited from Base

environment_config_path, environment_debug, option_function, param_config_path

Instance Method Details

#installerObject



38
39
40
41
42
43
44
# File 'lib/completely/commands/install.rb', line 38

def installer
  @installer ||= if stdin?
    Installer.from_io program:
  else
    Installer.new program:, script_path: input_script_path
  end
end

#runObject

Raises:



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/completely/commands/install.rb', line 25

def run
  if args['--dry']
    puts installer.install_command_string
    return
  end

  success = installer.install force: args['--force']
  raise InstallError, "Failed running command:\nnb`#{installer.install_command_string}`" unless success

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