Skip to content

Commit

Permalink
[apache#5976] Improvement(bin):Add validation checks to the startup s…
Browse files Browse the repository at this point in the history
…cripts to prevent incorrect usage
  • Loading branch information
liuchunhao committed Dec 24, 2024
1 parent a58b7f8 commit a5dec5f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions bin/common.sh → bin/common.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
# 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
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ tasks {
fileName.replace(".template", "")
}
eachFile {
if (name == "gravitino-env.sh") {
if (name == "gravitino-env.sh" || name == "common.sh") {
filter { line ->
line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
}
Expand Down Expand Up @@ -643,7 +643,7 @@ tasks {
fileName.replace(".template", "")
}
eachFile {
if (name == "gravitino-env.sh") {
if (name == "gravitino-env.sh" || name == "common.sh") {
filter { line ->
line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
}
Expand Down

0 comments on commit a5dec5f

Please sign in to comment.