From d703cd1825ee854d03c712e2d85f8c33598110b6 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 10 May 2022 16:31:37 -0700 Subject: [PATCH] SAGE_ROOT/sage: Actually unconditionally determine SAGE_ROOT from -zsh --- sage | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sage b/sage index 1e31cbcb50a..10b53023fbe 100755 --- a/sage +++ b/sage @@ -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`