Method: Linecook::Commands::Run#process

Defined in:
lib/linecook/commands/run.rb

#process(*package_dirs) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/linecook/commands/run.rb', line 34

def process(*package_dirs)
  opts = {
    'D' => full_path_to_remote_dir,
    'F' => ssh_config_file,
    'x' => xtrace
  }

  if scp
    sh! "sh #{SCP_SCRIPT} #{format(opts)} #{package_dirs.join(' ')}"
  end

  remote_scripts.each do |remote_script|
    script_opts = {'S' => remote_script}.merge(opts)
    sh! "sh #{RUN_SCRIPT} #{format(script_opts)} #{package_dirs.join(' ')}"
  end
end