Class: Slk::Services::SetupWizard

Inherits:
Object
  • Object
show all
Defined in:
lib/slk/services/setup_wizard.rb

Overview

Interactive setup wizard for configuring workspaces

Instance Method Summary collapse

Constructor Details

#initialize(runner:, config:, token_store:, output:) ⇒ SetupWizard

Returns a new instance of SetupWizard.



7
8
9
10
11
12
# File 'lib/slk/services/setup_wizard.rb', line 7

def initialize(runner:, config:, token_store:, output:)
  @runner = runner
  @config = config
  @token_store = token_store
  @output = output
end

Instance Method Details

#runInteger

Run the setup wizard

Returns:

  • (Integer)

    exit code (0 for success, 1 for error)



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/slk/services/setup_wizard.rb', line 16

def run
  print_header

  return 0 if skip_if_configured?

  setup_encryption unless @config.ssh_key
  result = setup_workspace
  return result if result != 0

  print_success
  0
end