Commit c3f5e73b authored by Robert Ricci's avatar Robert Ricci
Browse files

Added a way for callers to get the ouput of a command run with

ExecQuiet
parent 9375ede0
...@@ -318,7 +318,9 @@ sub CreateFileFatal($@) { ...@@ -318,7 +318,9 @@ sub CreateFileFatal($@) {
# #
# Execute a program, hiding its stdout and stderr from the user, but saving # Execute a program, hiding its stdout and stderr from the user, but saving
# them for later use. Returns the exit value of the program. # them for later use. Returns the exit value of the program if used in scalar
# context, or an array composed of the exit status and output if used in array
# context.
# #
sub ExecQuiet(@) { sub ExecQuiet(@) {
my @commnads = @_; my @commnads = @_;
...@@ -339,7 +341,11 @@ sub ExecQuiet(@) { ...@@ -339,7 +341,11 @@ sub ExecQuiet(@) {
@libinstall::lastExecOutput = @output; @libinstall::lastExecOutput = @output;
$libinstall::lastCommand = $commandstr; $libinstall::lastCommand = $commandstr;
if (wantarray) {
return ($exit_value, @output);
} else {
return $exit_value; return $exit_value;
}
} }
# #
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment