From eb1d6bd7172e3ac0719a97ac5a28026f65d0be5c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:55:53 +0200 Subject: [PATCH] Fix --- ct/tianji.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/tianji.sh b/ct/tianji.sh index 47ee221e..449104df 100644 --- a/ct/tianji.sh +++ b/ct/tianji.sh @@ -59,7 +59,7 @@ if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit fi -RELEASE=$(wget -q https://github.com/msgbyte/tianji/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) +RELEASE=$(curl -s https://api.github.com/repos/msgbyte/tianji/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then msg_info "Stopping ${APP} Service" @@ -68,7 +68,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_v msg_info "Updating ${APP} to ${RELEASE}" cd /opt/tianji - git checkout -q $RELEASE + git checkout -q v${RELEASE} pnpm db:migrate:apply >/dev/null 2>&1 echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated ${APP} to ${RELEASE}"