Skip to content

Commit

Permalink
***TEMP - FIX R PACKAGE MIRROR CONFIG (AWAITING UPSTREAM MERGE)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyry committed Feb 1, 2025
1 parent 755f989 commit fe55cbb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ $DaemonConfig = @"
$DaemonConfig | Out-File -Encoding Ascii ( New-Item -Path $env:ProgramData\docker\config\daemon.json -Force )

# R config
# $RconfigFilePathWindows = C:\Progra~1\R\4.1.2\etc\Rprofile.site
#Add-Content $RconfigFilePathWindows "local({`n r <- getOption(`"repos`")`n r[`"Nexus`"] <- `"${nexus_proxy_url}/repository/r-proxy/`"`n options(repos = r)`n})"
# echo "local({`n r <- getOption(`"repos`")`n r[`"Nexus`"] <- `"${nexus_proxy_url}/repository/r-proxy/`"`n options(repos = r)`n})" > $RconfigFilePathWindows
$RConfig = @"
local({
r <- getOption("repos")
r["Nexus"] <- "${nexus_proxy_url}/repository/r-proxy/"
options(repos = r)
})
"@
$RConfig | Out-File -Encoding Ascii ( New-Item -Path $Env:ProgramFiles\R\R-4.1.2\etc\Rprofile.site -Force )

$RBasePath = "$Env:ProgramFiles\R"
$RVersions = Get-ChildItem -Path $RBasePath -Directory | Where-Object { $_.Name -like "R-*" }

foreach ($RVersion in $RVersions) {
$ConfigPath = Join-Path -Path $RVersion.FullName -ChildPath "etc\Rprofile.site"
$RConfig | Out-File -Encoding Ascii (New-Item -Path $ConfigPath -Force)
}

0 comments on commit fe55cbb

Please sign in to comment.