Skip to content

Commit c104f2d

Browse files
runOSCommand(): Add arguments stdout = TRUE and stderr = TRUE
1 parent bf28082 commit c104f2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/runOSCommand.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @importFrom checkmate assertCharacter assertString %??%
22
#' @importFrom stringi stri_replace_all_fixed stri_flatten
3-
runOSCommand = function(sys.cmd, sys.args = character(0L), stdin = "", nodename = "localhost") {
3+
runOSCommand = function(sys.cmd, sys.args = character(0L), stdin = "", stdout = TRUE, stderr = TRUE, nodename = "localhost") {
44
assertCharacter(sys.cmd, any.missing = FALSE, len = 1L)
55
assertCharacter(sys.args, any.missing = FALSE)
66
assertString(nodename, min.chars = 1L)
@@ -18,7 +18,7 @@ runOSCommand = function(sys.cmd, sys.args = character(0L), stdin = "", nodename
1818
"!DEBUG [runOSCommand]: cmd: `sys.cmd` `stri_flatten(sys.args, ' ')`"
1919

2020
if (nzchar(Sys.which(sys.cmd))) {
21-
res = suppressWarnings(system2(command = sys.cmd, args = sys.args, stdin = stdin, stdout = TRUE, stderr = TRUE, wait = TRUE))
21+
res = suppressWarnings(system2(command = sys.cmd, args = sys.args, stdin = stdin, stdout = stdout, stderr = stderr, wait = TRUE))
2222
output = as.character(res)
2323
exit.code = attr(res, "status") %??% 0L
2424
} else {

0 commit comments

Comments
 (0)