Class: Nutella::Stop

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

Instance Method Summary collapse

Instance Method Details

#run(args = nil) ⇒ Object

Is current directory a nutella prj?



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

def run(args=nil)
  if !Nutella.currentProject.exist? 
    return
  end
  runid = Nutella.runlist.extractRunId args[0]
  # Removes the run from the list of runs if it exists
  removeRunfromList(runid, args[0]) 
  # Stop broker if needed
  if Nutella.runlist.empty? and Nutella.config['broker'] == "localhost" 
    stopBroker
  end
  # Stops all the bots
  Tmux.killSession(runid) 
  # Deletes bots config file if it exists
  deleteBotsConfigFile
  # Output success message
  outputSuccessMessage(runid, args[0])
end