From f03aed23f8ea8020bc76ae82efbf4dd77b2f4a64 Mon Sep 17 00:00:00 2001 From: aceforeverd Date: Fri, 12 Jul 2024 13:22:20 +0800 Subject: [PATCH] fix(scripts): deploy spark correctly $SPARK_HOME may be a symbolic link referring to a invalid directory, so we'd try 'rm -f' first --- release/sbin/deploy-all.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release/sbin/deploy-all.sh b/release/sbin/deploy-all.sh index ddfc7e712cd..3fad5fb14f0 100755 --- a/release/sbin/deploy-all.sh +++ b/release/sbin/deploy-all.sh @@ -128,7 +128,12 @@ function download_spark { if [[ -z "${SPARK_HOME}" ]]; then echo "[ERROR] SPARK_HOME is not set" else - if [[ ! -e "${SPARK_HOME}" ]]; then + if [[ ! -d "${SPARK_HOME}" ]]; then + # SPARK_HOME may be symbolic link, -d will consider only directory exists, + # this filter out existing symbolic link refer to a non-exists directory. + # And we'd try rm it first + rm -fv "${SPARK_HOME}" + echo "Downloading openmldbspark..." spark_name=spark-3.2.1-bin-openmldbspark spark_tar="${spark_name}".tgz