Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#9075] fix CLI jar selection when multiple CLI jars exist (issue #9075) (#9203)

kooks866eef7a8cae
diff --git a/bin/gcli.sh.template b/bin/gcli.sh.template
index cfa61c2a1a..24ba620ccc 100644
--- a/bin/gcli.sh.template
+++ b/bin/gcli.sh.template
@@ -29,7 +29,7 @@ AUXLIB_DIR="${GRAVITINO_HOME}/auxlib"
# Search strategy for finding the Gravitino CLI JAR:
if [ -z "$CLI_JAR" ]; then
- CLI_JAR=$(find "${AUXLIB_DIR}" -name "gravitino-cli-*.jar" 2>/dev/null)
+ CLI_JAR=$(ls -1 "${AUXLIB_DIR}"/gravitino-cli-*.jar 2>/dev/null | sort -V | tail -n 1)
fi
if [ -z "$CLI_JAR" ]; then