From 6876114fdf5c9c476fa444e13544c241cd0c9498 Mon Sep 17 00:00:00 2001 From: Takanori TANIGUCHI Date: Sun, 28 Aug 2022 09:45:14 +0900 Subject: [PATCH] Fix libreoffice download url --- fragments/labels/libreoffice.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fragments/labels/libreoffice.sh b/fragments/labels/libreoffice.sh index 2befca5..c8fab45 100644 --- a/fragments/labels/libreoffice.sh +++ b/fragments/labels/libreoffice.sh @@ -2,11 +2,11 @@ libreoffice) name="LibreOffice" type="dmg" if [[ $(arch) == "arm64" ]]; then - downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/aarch64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_aarch64.dmg" - elif [[ $(arch) == "i386" ]]; then - downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/x86_64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_x86-64.dmg" + arch_type="aarch64" fi - appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g' ) + libreoffice_latest_version="$(curl -Ls https://www.libreoffice.org/download/download-libreoffice/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)" + downloadURL="https://download.documentfoundation.org/libreoffice/stable/${libreoffice_latest_version}/mac/${arch_type:-x86_64}/LibreOffice_${libreoffice_latest_version}_MacOS_${arch_type:-x86-64}.dmg" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g') expectedTeamID="7P5S3ZLCN7" blockingProcesses=( soffice ) ;;