From d10ffebe355b0bbd2d2c32cecc701d6e691b47cf Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Tue, 12 Sep 2023 14:57:42 +0200 Subject: [PATCH] Fix dictionary download on mac when osx-bundle is run more than once --- tools/osx-bundle.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/osx-bundle.sh b/tools/osx-bundle.sh index a1563a481..29e0fbfd9 100755 --- a/tools/osx-bundle.sh +++ b/tools/osx-bundle.sh @@ -61,10 +61,12 @@ echo "---- Copying dictionaries ----" if test -f "${DICT_DIR}"; then cp -v "${DICT_DIR}/*" "${PKG_DIR}/Contents/SharedSupport/dictionaries" else - echo "Specified dictionary directory ${DICT_DIR} not found. Downloading dictionaries:" - mkdir "${BUILD_DIR}/dictionaries" - curl -L "https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip" -o "${BUILD_DIR}/dictionaries/en_US.zip" - unzip "${BUILD_DIR}/dictionaries/en_US.zip" -d "${BUILD_DIR}/dictionaries" + mkdir -p "${BUILD_DIR}/dictionaries" + if ! test -f "${BUILD_DIR}/dictionaries/en_US.aff"; then + echo "Specified dictionary directory ${DICT_DIR} not found. Downloading dictionaries:" + curl -L "https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip" -o "${BUILD_DIR}/dictionaries/en_US.zip" + unzip "${BUILD_DIR}/dictionaries/en_US.zip" -d "${BUILD_DIR}/dictionaries" + fi cp -v "${BUILD_DIR}/dictionaries/en_US.aff" "${PKG_DIR}/Contents/SharedSupport/dictionaries" cp -v "${BUILD_DIR}/dictionaries/en_US.dic" "${PKG_DIR}/Contents/SharedSupport/dictionaries" fi