From fe87ce53ac10e1f934aa1d3051662e5b1fa2e9c7 Mon Sep 17 00:00:00 2001 From: Chun-Hao Liu Date: Wed, 25 Dec 2024 10:48:59 +0800 Subject: [PATCH] [#5976] Improvement(bin): Update the error message for startup failures /Adjust the version check /Revert the root build.gradle.kts files --- bin/common.sh | 12 +++++------- build.gradle.kts | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bin/common.sh b/bin/common.sh index a2fc0cedadc..33ea68db12b 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -18,13 +18,6 @@ # Referred from Apache Submarine's common.sh implementation # bin/common.sh -GRAVITINO_VERSION=GRAVITINO_VERSION_PLACEHOLDER -if [[ "$GRAVITINO_VERSION" == *_VERSION_PLACEHOLDER ]]; then - echo "GRAVITINO_VERSION is not set. Please make sure you are running the script from the distribution/package/bin and before running the script, run './gradle clean build -x test compileDistribution'" - exit 1 -fi - - if [ -L "${BASH_SOURCE-$0}" ]; then FWDIR=$(dirname "$(readlink "${BASH_SOURCE-$0}")") else @@ -49,6 +42,11 @@ if [[ -f "${GRAVITINO_CONF_DIR}/gravitino-env.sh" ]]; then . "${GRAVITINO_CONF_DIR}/gravitino-env.sh" fi +if [[ -z "${GRAVITINO_VERSION}" ]]; then + echo -e "No GRAVITINO_VERSION was found, you may need to:\n1. Run the gravitino.sh script on the compiled Gravitino.\n2. Run the gravitino.sh script in the release package." + exit 1 +fi + GRAVITINO_CLASSPATH+=":${GRAVITINO_CONF_DIR}" JVM_VERSION=8 diff --git a/build.gradle.kts b/build.gradle.kts index d4c5e33ce01..5e93992e34e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -598,7 +598,7 @@ tasks { fileName.replace(".template", "") } eachFile { - if (name == "gravitino-env.sh" || name == "common.sh") { + if (name == "gravitino-env.sh") { filter { line -> line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version") } @@ -643,7 +643,7 @@ tasks { fileName.replace(".template", "") } eachFile { - if (name == "gravitino-env.sh" || name == "common.sh") { + if (name == "gravitino-env.sh") { filter { line -> line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version") }