Method: Flaun#start

Defined in:
lib/flaun.rb

#start(target_name = nil, config_file = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/flaun.rb', line 28

def start(target_name = nil, config_file = nil)
  config_file ||= default_config_file
  unless File.exist? config_file
    not_found_config_file
    exit 1
  end
  config = config_load(open(config_file).read, config_file)

  if target_name.nil?
    not_target_name config
    exit 1
  end

  target = config[target_name.to_sym]

  ssh_forward_and_launch target
end