Skip to content

Commit 906486e

Browse files
author
Ataxexe
committed
follow symlinks to get soda home
1 parent 2472ae5 commit 906486e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

soda

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424

2525
if [[ -z "$SODA_HOME" ]]; then
26-
PRG="$0"
27-
while [ -h "$PRG" ] ; do
28-
ls=$(ls -ld "$PRG")
26+
local script="$0"
27+
while [ -h "$script" ] ; do
28+
ls=$(ls -ld "$script")
2929
link=$(expr "$ls" : '.*-> \(.*\)$')
3030
if expr "$link" : '/.*' > /dev/null; then
31-
PRG="$link"
31+
script="$link"
3232
else
33-
PRG="$(dirname "$PRG")/$link"
33+
script="$(dirname "$script")/$link"
3434
fi
3535
done
36-
SODA_HOME=$(dirname "$PRG")
36+
SODA_HOME=$(dirname "$script")
3737
SODA_HOME=$(cd "$SODA_HOME" && pwd -P)
3838
fi
3939
[[ -z "$SODA_USER_HOME" ]] && SODA_USER_HOME=$HOME/.soda

0 commit comments

Comments
 (0)