Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #29345: replace a few obsolete "-a" tests with "-e".
Browse files Browse the repository at this point in the history
The "-a" test in bash means "file exists," but the standard POSIX "-e"
is more portable and works in bash anyway, so let's use that.
  • Loading branch information
orlitzky committed May 30, 2020
1 parent bc3ea8e commit fb475f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bin/sage-env
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ unset R_PROFILE
if [ -d "$SAGE_LOCAL/lib/R/share" ] ; then
R_MAKEVARS_SITE="$SAGE_LOCAL/lib/R/share/Makevars.site" && export R_MAKEVARS_SITE
if ! [ -f "$R_MAKEVARS_SITE" ] ; then
if ! [ -a "$R_MAKEVARS_SITE" ] ; then
if ! [ -e "$R_MAKEVARS_SITE" ] ; then
echo "## Empty site-wide Makevars file for Sage's R" > "$R_MAKEVARS_SITE"
else
>&2 echo "Warning: $R_MAKEVARS_SITE exists and is not a file : trouble ahead..."
Expand All @@ -472,15 +472,15 @@ if [ -d "$SAGE_LOCAL/lib/R/share" ] ; then
fi
if [ -d "$DOT_SAGE" ] ; then
if ! [ -d "$DOT_SAGE/R" ] ; then
if ! [ -a "$DOT_SAGE/R" ] ; then
if ! [ -e "$DOT_SAGE/R" ] ; then
mkdir -p "$DOT_SAGE/R"
else
>&2 echo "Warning: $DOT_SAGE/R exists and is not a directory : trouble ahead..."
fi
fi
R_MAKEVARS_USER="$DOT_SAGE/R/Makevars.user" && export R_MAKEVARS_USER
if ! [ -f "$R_MAKEVARS_USER" ] ; then
if ! [ -a "$R_MAKEVARS_USER" ] ; then
if ! [ -e "$R_MAKEVARS_USER" ] ; then
echo "## Empty user-specific Makevars file for Sage's R" > "$R_MAKEVARS_USER"
else
>&2 echo "Warning: $R_MAKEVARS_USER exists and is not a file : trouble ahead..."
Expand Down

0 comments on commit fb475f3

Please sign in to comment.