Repository: incubator-s2graph Updated Branches: refs/heads/branch-0.2.0 917475b62 -> 61bf40c03
S2GRAPH-159: simplified path resolution that fixes the issue Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/542a3f76 Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/542a3f76 Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/542a3f76 Branch: refs/heads/branch-0.2.0 Commit: 542a3f76aef9399cc94b85667c54a8894ba07e9b Parents: 917475b Author: Sergio Fernández <[email protected]> Authored: Fri Aug 11 05:15:38 2017 +0200 Committer: Sergio Fernández <[email protected]> Committed: Fri Aug 11 05:15:38 2017 +0200 ---------------------------------------------------------------------- bin/s2graph-env.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/542a3f76/bin/s2graph-env.sh ---------------------------------------------------------------------- diff --git a/bin/s2graph-env.sh b/bin/s2graph-env.sh index 0145e1d..66941b7 100644 --- a/bin/s2graph-env.sh +++ b/bin/s2graph-env.sh @@ -18,16 +18,8 @@ # Should be sourced and not be directly executed. # The executable flag for this file should not be set, e.g. 644. -# Find the current directory -SOURCE="${BASH_SOURCE[0]}" -# resolve $SOURCE until the file is no longer a symlink -while [ -h "$SOURCE" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +# find the current directory +DIR=$(cd "$(dirname "${BASH_SOURCE-$0}")">/dev/null; pwd) # set S2GRAPH_HOME if [ -z $S2GRAPH_HOME ]; then
