lib/bolt/shell/bash.rb
def check_sudo(out, inp, stdin)
        buffer = out.readpartial(CHUNK_SIZE)
        # Split on newlines, including the newline
        lines = buffer.split(/(?<=\n)/)
        # handle_sudo will return the line if it is not a sudo prompt or error
        lines.map! { |line| handle_sudo(inp, line, stdin) }
        lines.join("")
      # If stream has reached EOF, no password prompt is expected
      # return an empty string
      rescue EOFError
        ''
      end
# See if there's a sudo prompt in the output
# If not, return the output
See if there's a sudo prompt in the output
If not, return the output
See if there ' s a sudo prompt in the output If not return the output
def check_sudo(out, inp, stdin)
        buffer = out.readpartial(CHUNK_SIZE)
        lines = buffer.split(/(?<=\n)/)
        lines.map! { |line| handle_sudo(inp, line, stdin) }
        lines.join("")
      rescue EOFError
        ''
      end
def check_sudo ( out , inp , stdin ) buffer = out . readpartial ( CHUNK_SIZE ) lines = buffer . split ( / (?<= \n ) / ) lines . map! { | line | handle_sudo ( inp , line , stdin ) } lines . join ( "" ) rescue EOFError '' end
See if there's a sudo prompt in the output
If not, return the output
See if there ' s a sudo prompt in the output If not return the output
# Split on newlines, including the newline # handle_sudo will return the line if it is not a sudo prompt or error # If stream has reached EOF, no password prompt is expected # return an empty string
out
inp
stdin