aroundabout commented on code in PR #2302:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2302#discussion_r1315898464


##########
hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh:
##########
@@ -18,12 +18,30 @@
 OPEN_MONITOR="false"
 OPEN_SECURITY_CHECK="true"
 DAEMON="true"
-PRELOAD="false"
 #VERBOSE=""
 GC_OPTION=""
 USER_OPTION=""
 SERVER_STARTUP_TIMEOUT_S=30
 
+function abs_path() {
+    SOURCE="${BASH_SOURCE[0]}"
+    while [[ -h "$SOURCE" ]]; do
+        DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
+        SOURCE="$(readlink "$SOURCE")"
+        [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
+    done
+    cd -P "$(dirname "$SOURCE")" && pwd
+}
+
+BIN=$(abs_path)
+TOP="$(cd "$BIN"/../ && pwd)"
+CONF="$TOP/conf"
+LOGS="$TOP/logs"
+SCRIPTS="$TOP/scripts"
+PID_FILE="$BIN/pid"
+
+. "$BIN"/util.sh
+

Review Comment:
   
![image](https://github.com/apache/incubator-hugegraph/assets/49650772/fb3b5c8d-fe2d-4536-9f9d-e60b3d6fff11)
   
   I have made an easy test.
   1. move function `abs_path` to util.sh
   2. mkdir a test folder and move `util.sh` in it
   3. touch a test shell to call the `abs_path` in `/bin/test/util.sh`
   4. echo the result and show `xxx/apache-hugegraph-incubating-1.0.0/bin/test`
   
   As a result, we cannot move `abs_path` to `util.sh`. For example, if a shell 
is not in the same folder with util.sh, we cannot get the expected result.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to