Method: Windows::Exec#prepend_commands

Defined in:
lib/beaker/host/windows/exec.rb

#prepend_commands(command = '', user_pc = nil, opts = {}) ⇒ String

Gets the specific prepend commands as needed for this host

Parameters:

  • command (String) (defaults to: '')

    Command to be executed

  • user_pc (String) (defaults to: nil)

    List of user-specified commands to prepend

  • opts (Hash) (defaults to: {})

    optional parameters

Options Hash (opts):

  • :cmd_exe (Boolean)

    whether cmd.exe should be used

Returns:

  • (String)

    Command string as needed for this host



87
88
89
90
91
# File 'lib/beaker/host/windows/exec.rb', line 87

def prepend_commands(command = '', user_pc = nil, opts = {})
  cygwin_prefix = (self.is_cygwin? and opts[:cmd_exe]) ? 'cmd.exe /c' : ''
  spacing = (user_pc && !cygwin_prefix.empty?) ? ' ' : ''
  "#{cygwin_prefix}#{spacing}#{user_pc}"
end