Class: Revamp::Persister::Rpm::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/revamp/persister/rpm/commandline.rb

Overview

A command line executor for command line

Class Method Summary collapse

Class Method Details

.execute(command, directory, verbose) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/revamp/persister/rpm/commandline.rb', line 4

def execute(command, directory, verbose)
  Revamp.logger.debug("Executing: '#{command}' in directory: '#{directory}'")
  out = '/dev/null'
  out = $stdout if verbose
  pid = Process.spawn(command, chdir: directory, out: out, err: out)
  Process.wait pid
  $? # rubocop:disable SpecialGlobalVars
end