Skip to content

Commit

Permalink
Check env var CONDA_KEEP_R_LIBS_USER before removing R_LIBS_USER.
Browse files Browse the repository at this point in the history
This allows the user to continue using a custom user library inside of
the conda environment.
  • Loading branch information
jdblischak committed May 28, 2019
1 parent f2b2c54 commit 558a89e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recipe/activate-r-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if [[ ! -z ${RSTUDIO_WHICH_R+x} ]]; then
fi
export RSTUDIO_WHICH_R="$CONDA_PREFIX/bin/R"

# store existing R_LIBS_USER
if [[ ! -z ${R_LIBS_USER+x} ]]; then
# store existing R_LIBS_USER if the user has not set CONDA_KEEP_R_LIBS_USER
if [[ ! -z ${R_LIBS_USER+x} && -z ${CONDA_KEEP_R_LIBS_USER+x} ]]; then
export R_LIBS_USER_PREV="$R_LIBS_USER"
fi
unset R_LIBS_USER

0 comments on commit 558a89e

Please sign in to comment.