Skip to content

Commit

Permalink
Update zzz.R
Browse files Browse the repository at this point in the history
  • Loading branch information
davidycliao committed Jan 27, 2025
1 parent 2e8518f commit 63d4b1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ NULL
safe_setenv <- function(name, value) {
current <- Sys.getenv(name, unset = NA)
if (is.na(current) || current != value) {
Sys.setenv(!!name := value) # 使用命名參數
# 使用最基本的方式設置環境變量
do.call(Sys.setenv, stats::setNames(list(value), name))
return(TRUE)
}
return(FALSE)
Expand Down

0 comments on commit 63d4b1b

Please sign in to comment.