Skip to content

Commit 43ad5f3

Browse files
don't recover stderr and stdout on Windows when wait = FALSE
1 parent 3d77204 commit 43ad5f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

R/call.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ call_and_capture <- function(command, args, ..., wait = TRUE) {
2626
exit_status <- suppressWarnings(
2727
system2(command, args, ..., wait = wait, stdout = stdout, stderr = stderr)
2828
)
29+
# on Windows, there is no output when wait = FALSE
30+
if (is_windows() && !wait) {
31+
out <- list(
32+
stdout = "[cannot recover stdout for Windows when R option `precommit.block_install_hooks` is FALSE]",
33+
stderr = "[cannot recover stderr for Windows when R option `precommit.block_install_hooks` is FALSE]",
34+
exit_status = exit_status
35+
)
36+
return(out)
37+
}
2938
stderr <- readLines(stderr)
3039
if (isTRUE(any(grepl("error", stderr, ignore.case = TRUE)))) {
3140
# conda run has exit status 0 but stderr with ERROR, we need to set exit

0 commit comments

Comments
 (0)