lib/wire/execution/local_exec.rb
# constructs the single command line string from
# given parameters.
# Returns
# - Command line as [String]
constructs the single command line string from
given parameters.
Returns
Command line as [String]
constructs the single command line string from given parameters . Returns Command line as [ String ]
def construct_command
        cmd_arr = []
        command_args = "#{@command} #{@args}".strip
        sudo_str = (@options[:b_sudo] ? 'sudo ' : '')
        if @options[:b_shell]
          cmd_arr << '/bin/sh'
          cmd_arr << '-c'
          cmd_arr << "'#{sudo_str}#{command_args}'"
        else
          cmd_arr << "#{sudo_str}#{command_args}"
        end
        cmd_arr.join(' ').strip
      end
def construct_command cmd_arr = [ ] command_args = "#{@command} #{@args}" . strip sudo_str = ( @options [ :b_sudo ] ? 'sudo ' : '' ) if @options [ :b_shell ] cmd_arr << '/bin/sh' cmd_arr << '-c' cmd_arr << "'#{sudo_str}#{command_args}'" else cmd_arr << "#{sudo_str}#{command_args}" end cmd_arr . join ( ' ' ) . strip end
constructs the single command line string from
given parameters.
constructs the single command line string from given parameters .