From 90b2200cc874dd94e7048e35bd1b87cdc7543e44 Mon Sep 17 00:00:00 2001 From: zyy17 Date: Thu, 3 Aug 2023 10:09:31 +0800 Subject: [PATCH] chore!: modify install.sh to adapt the new release package format (#2077) chore: modify install.sh to adapt the new release package format --- scripts/install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index eb2e9c5f5d3d..5740c565edca 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -61,7 +61,16 @@ if [ -n "${OS_TYPE}" ] && [ -n "${ARCH_TYPE}" ]; then fi echo "Downloading ${BIN}, OS: ${OS_TYPE}, Arch: ${ARCH_TYPE}, Version: ${VERSION}" + PACKAGE_NAME="${BIN}-${OS_TYPE}-${ARCH_TYPE}-${VERSION}.tar.gz" - wget "https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/${VERSION}/${BIN}-${OS_TYPE}-${ARCH_TYPE}.tgz" - tar xvf ${BIN}-${OS_TYPE}-${ARCH_TYPE}.tgz && rm ${BIN}-${OS_TYPE}-${ARCH_TYPE}.tgz && echo "Run './${BIN} --help' to get started" + if [ -n "${PACKAGE_NAME}" ]; then + wget "https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/${VERSION}/${PACKAGE_NAME}" + + # Extract the binary and clean the rest. + tar xvf "${PACKAGE_NAME}" && \ + mv "${PACKAGE_NAME%.tar.gz}/${BIN}" "${PWD}" && \ + rm -r "${PACKAGE_NAME}" && \ + rm -r "${PACKAGE_NAME%.tar.gz}" && \ + echo "Run './${BIN} --help' to get started" + fi fi