Skip to content

Commit 6c7dd80

Browse files
committed
fix: check if Rprofile exists first
1 parent a529521 commit 6c7dd80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

init-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ show_help() {
1313

1414
initialise_r() {
1515
if [ "${FORCE}" = true ] || [ ! -f "renv.lock" ]; then
16-
if grep -q 'source("renv/activate.R")' .Rprofile; then
16+
if [ -f ".Rprofile" ] && grep -q 'source("renv/activate.R")' .Rprofile; then
1717
sed -i '' '/source("renv\/activate.R")/d' .Rprofile
1818
fi
1919
Rscript -e 'renv::init(bare = FALSE)'

0 commit comments

Comments
 (0)