Skip to content

Commit

Permalink
do not drop stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
felixcheung committed Jan 22, 2017
1 parent 6113fe7 commit 294ce99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/pkg/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,12 @@ varargsToJProperties <- function(...) {
props
}

launchScript <- function(script, combinedArgs, capture = FALSE) {
launchScript <- function(script, combinedArgs, wait = FALSE) {
if (.Platform$OS.type == "windows") {
scriptWithArgs <- paste(script, combinedArgs, sep = " ")
shell(scriptWithArgs, translate = TRUE, wait = capture, intern = capture) # nolint
shell(scriptWithArgs, translate = TRUE, wait = wait, intern = wait) # nolint
} else {
system2(script, combinedArgs, wait = capture, stdout = capture)
system2(script, combinedArgs, wait = wait)
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/pkg/inst/tests/testthat/test_Windows.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_that("sparkJars tag in SparkContext", {
if (.Platform$OS.type != "windows") {
skip("This test is only for Windows, skipped")
}
testOutput <- launchScript("ECHO", "a/b/c", capture = TRUE)
testOutput <- launchScript("ECHO", "a/b/c", wait = TRUE)
abcPath <- testOutput[1]
expect_equal(abcPath, "a\\b\\c")
})

0 comments on commit 294ce99

Please sign in to comment.