Class: Nutella::Checkup

Inherits:
Command show all
Defined in:
lib/core/commands/checkup.rb

Instance Method Summary collapse

Instance Method Details

#run(args = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/core/commands/checkup.rb', line 8

def run(args=nil)
  # First check that we have all the tools we need to run nutella
  if !allDependenciesInstalled?
    return
  end
  
  # Check if we have a broker and install one if not
  if !File.directory? Nutella.config["broker_dir"]
    console.warn "You don't seem to have a local broker installed so we are going to go ahead and install one for you. This might take some time..."
    if !installBroker
      console.error "Whoops...something went wrong while installing the broker. "
      return
    end
  else
    console.info "You have a local broker installed. Yay!"
  end
      
  # Set config and output message
  Nutella.config["ready"] = true
  console.success("All systems go! You are ready to use nutella!")
end