Method: Sunshine::Shell#env_cmd

Defined in:
lib/sunshine/shell.rb

#env_cmd(cmd, env_hash = @env) ⇒ Object

Build an env command if an env_hash is passed



223
224
225
226
227
228
229
# File 'lib/sunshine/shell.rb', line 223

def env_cmd cmd, env_hash=@env
  if env_hash && !env_hash.empty?
    env_vars = env_hash.map{|e| e.join("=")}
    cmd = ["env", env_vars, cmd].flatten
  end
  cmd
end