Skip to content

Commit

Permalink
powershell desktop and try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed May 27, 2020
1 parent 9d15360 commit 4e21788
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ Write-Output "Done installing Rtools"

Write-Output "Installing dependencies"
$packages = "c('data.table', 'jsonlite', 'httr', 'Matrix', 'processx', 'R6', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')"
$r_install_command = "options(install.packages.check.source = `'no`'); install.packages($packages, repos = `'$env:CRAN_MIRROR`', type = `'binary`', lib = `'$env:R_LIB_PATH`', quiet = TRUE, verbose = FALSE)"

# try {{
# $ErrorActionPreference='SilentlyContinue';
# Rscript --vanilla -e "`"$r_install_command`""
# }} catch {{
# Write-Output "install.packages() wrote to stdout"
# }}
Invoke-Expression -ErrorAction SilentlyContinue -Command "Rscript --vanilla -e `"$r_install_command`"" *> out.txt ; Check-Output $?
Get-Content -Path out.txt
$r_install_command = "options(install.packages.check.source = `'no`'); install.packages($packages, repos = `'$env:CRAN_MIRROR`', type = `'binary`', lib = `'$env:R_LIB_PATH`')"

try {{
$ErrorActionPreference='SilentlyContinue';
Rscript --vanilla -e "`"$r_install_command`""
}} catch {{
Write-Output "install.packages() wrote to stdout"
}}
# Invoke-Expression -ErrorAction SilentlyContinue -Command "Rscript --vanilla -e `"$r_install_command`"" *> out.txt ; Check-Output $?
# Get-Content -Path out.txt

# MiKTeX and pandoc can be skipped on non-MINGW builds, since we don't
# build the package documentation for those
Expand Down

0 comments on commit 4e21788

Please sign in to comment.