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

Commit

Permalink
SAGE_ROOT/sage: Actually unconditionally determine SAGE_ROOT from -zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed May 10, 2022
1 parent 252372d commit d703cd1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sage
Expand Up @@ -108,15 +108,12 @@ resolvelinks() {
# (The updated README.md and installation manual from Trac #33787 recommend to
# symlink the installed version of the src/bin/sage script instead.)

if [ -z "$SAGE_ROOT" ]; then
# Get the path to $0 (this shell script) with all symbolic links
# resolved
SAGE_ROOT=`resolvelinks "$0"` || \
# Get the path to $0 (this shell script) with all symbolic links resolved
SAGE_ROOT=`resolvelinks "$0"` || \
SAGE_ROOT="$0"

# Get the directory component
SAGE_ROOT="${SAGE_ROOT%/*}"
fi
# Get the directory component
SAGE_ROOT="${SAGE_ROOT%/*}"

# Make SAGE_ROOT absolute
SAGE_ROOT=`cd "$SAGE_ROOT" && pwd -P`
Expand Down

0 comments on commit d703cd1

Please sign in to comment.