Make java version check work on all shells (#9376)

* Make java version check work on all shells

Previously, "perl verify-java" would fail on shells like zsh, which
would cause the quickstart scripts (e.g., bin/start-micro-quickstart) to
fail unless the DRUID_SKIP_JAVA_SKIP environment variable is set.

* Support dash (ubuntu)
This commit is contained in:
Chi Cao Minh 2020-02-19 13:44:00 -08:00 committed by GitHub
parent b408a6d774
commit 26eeba636a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ get_java_bin_dir() {
elif [ ! -z "$(command -v java)" ]; then
# Strip /java from the location of where java is installed
JAVA_ON_PATH="$(command -v java)"
echo -n "${JAVA_ON_PATH%/java}"
printf "${JAVA_ON_PATH%/java}"
else
printf ""
fi

View File

@ -52,7 +52,7 @@ if ($skip_var && $skip_var ne "0" && $skip_var ne "false" && $skip_var ne "f") {
}
my $cwd = dirname(__FILE__);
my $java_bin_dir = `source $cwd/java-util && get_java_bin_dir 2>&1`;
my $java_bin_dir = `. $cwd/java-util && get_java_bin_dir 2>&1`;
# If we could not find java
if ($java_bin_dir eq "") {