[1/2] incubator-s2graph git commit: S2GRAPH-159: simplified path resolution that fixes the issue

2017-08-11 Thread steamshon
Repository: incubator-s2graph
Updated Branches:
  refs/heads/master 339be374f -> ea734a93e


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/7b40c3e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/7b40c3e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/7b40c3e8

Branch: refs/heads/master
Commit: 7b40c3e8ecdd61ea1a9340ff586f1f7f40f5d947
Parents: 339be37
Author: Sergio Fernández 
Authored: Fri Aug 11 05:15:38 2017 +0200
Committer: DO YUNG YOON 
Committed: Fri Aug 11 17:20:52 2017 +0900

--
 bin/s2graph-env.sh | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/7b40c3e8/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



[1/2] incubator-s2graph git commit: S2GRAPH-159: simplified path resolution that fixes the issue

2017-08-10 Thread steamshon
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 
Authored: Fri Aug 11 05:15:38 2017 +0200
Committer: Sergio Fernández 
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