mmdl: fix release parsing in mmdl.sh

This commit is contained in:
vhsdream 2025-06-04 08:23:25 -04:00
parent b5dd69a7c0
commit bac998fc10
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ function update_script() {
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/mmdl_version.txt)" ]] || [[ ! -f /opt/mmdl_version.txt ]]; then
msg_info "Stopping $APP"
systemctl stop mmdl

View File

@ -34,7 +34,7 @@ $STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH
} >>~/mmdl.creds
msg_ok "Set up Database"
msg_info "Setup ${APPLICATION}"
msg_info "Installing ${APPLICATION}"
RELEASE=$(curl -s https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSLO "https://github.com/intri-in/manage-my-damn-life-nextjs/archive/refs/tags/v${RELEASE}.zip"
unzip -q v"$RELEASE".zip
@ -57,7 +57,7 @@ $STD npm install
$STD npm run migrate
$STD npm run build
echo "${RELEASE}" >/opt/mmdl_version.txt
msg_ok "Setup ${APPLICATION}"
msg_ok "Installed ${APPLICATION}"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/mmdl.service