Skip to content
Permalink
Browse files

Tweak to the runner to deal with the big bad world.

Relative symlinks which start with .. are then run with an
absolute path.  It's robustness city.
  • Loading branch information
paulp committed May 13, 2012
1 parent c5200ba commit 4cd0253d0d461d01672334d240bc5249027f536b
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -9,10 +9,19 @@
##############################################################################

findScalaHome () {
# see #2092
# see SI-2092
local SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
( cd -P "$( dirname "$SOURCE" )"/.. && pwd )
local bindir="$( dirname "$SOURCE" )"
if [[ -d "$bindir"/.. ]]; then
( cd -P "$bindir"/.. && pwd )
else
# See SI-5792
local dir=$(dirname "${BASH_SOURCE[0]}")
local link=$(dirname "$(readlink "${BASH_SOURCE[0]}")")
local path="$dir/$link/.."
( cd "$path" && pwd )
fi
}
execCommand () {
[[ -n $SCALA_RUNNER_DEBUG ]] && echo "" && for arg in "$@@"; do echo "$arg"; done && echo "";

0 comments on commit 4cd0253

Please sign in to comment.
You can’t perform that action at this time.