From f355d3857d0ae0368fda1297591c82622a4f3499 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 4 May 2023 18:29:38 +0800 Subject: [PATCH] refactor: update check .xz.sha256 file extension. (#167) - Simplify the `sha256_file` variable assignment in `bump_version.sh` We always have `.xz.sha256` files. Signed-off-by: Bo-Yi Wu Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/167 Reviewed-by: Jason Song Reviewed-by: Lunny Xiao Co-authored-by: Bo-Yi Wu Co-committed-by: Bo-Yi Wu --- bump_version.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bump_version.sh b/bump_version.sh index 55bacf1..a8d988e 100755 --- a/bump_version.sh +++ b/bump_version.sh @@ -23,11 +23,7 @@ for bin in ${binaries};do file_url="https://dl.gitea.com/${bin}/${version}" for os in ${supported_os}; do - sha256_file="${bin}-${version}-${os}" - if [ "$os" != "linux-386" -a "$os" != "linux-arm64" ]; then - sha256_file="${sha256_file}.xz" - fi - sha256_file="${sha256_file}.sha256" + sha256_file="${bin}-${version}-${os}.xz.sha256" sha256=$(curl -sL "${file_url}/${sha256_file}" | awk '{print$1}') echo "update ${bin} os: ${os}, sha256: ${sha256}" sed -r "s/^(\s+when \"${os}\" then).*\"(.*)$/\1 \"${sha256}\"\2/" -i "${file}"