module Postgres::Clone::LocalCommands

Public Instance Methods

run_local(command, sudo: false, user: nil) click to toggle source
# File lib/postgres/clone/local_commands.rb, line 9
def run_local(command, sudo: false, user: nil)
  actual_command = build_command(command, sudo: sudo, user: user)
  log_command('localhost', actual_command)

  output = `#{actual_command}`

  CommandResult.new(exit_code: $?.exitstatus, output: output)
end
sudo_local(command, user: nil) click to toggle source
# File lib/postgres/clone/local_commands.rb, line 18
def sudo_local(command, user: nil)
  run_local(command, sudo: true, user: user)
end