You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "aroundabout (via GitHub)" <gi...@apache.org> on 2023/09/01 10:29:50 UTC
[GitHub] [incubator-hugegraph] aroundabout commented on a diff in pull request #2302: fix(dist): avoid var PRELOAD cover environmnet vars
aroundabout commented on code in PR #2302:
URL: https://github.com/apache/incubator-hugegraph/pull/2302#discussion_r1312730226
##########
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:
```suggestion
./util.sh
BIN=$(abs_path)
TOP="$(cd "$BIN"/../ && pwd)"
CONF="$TOP/conf"
LOGS="$TOP/logs"
SCRIPTS="$TOP/scripts"
PID_FILE="$BIN/pid"
```
Can we use relative path to call util.sh instead of use the abs_path to call it.
So that we can move the abs_path into util.sh.
Will the change result in potential impact? @javeme
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org