gitea: Update gitea.sh to stop update failures (#5361)

When updating gitea using the update command on Debian 12, if you have any other files or directories starting with the name gitea it will fail.

This update will make it use a set file name for the output and mv operation which resolves the issue.
This commit is contained in:
Tyler Stuyfzand 2025-06-22 06:27:01 -04:00 committed by GitHub
parent 70a1cfbe28
commit 08648aca15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,10 +29,11 @@ function update_script() {
fi
RELEASE=$(curl -fsSL https://github.com/go-gitea/gitea/releases/latest | grep "title>Release" | cut -d " " -f 4 | sed 's/^v//')
msg_info "Updating $APP to ${RELEASE}"
curl -fsSL "https://github.com/go-gitea/gitea/releases/download/v$RELEASE/gitea-$RELEASE-linux-amd64" -o $(basename "https://github.com/go-gitea/gitea/releases/download/v$RELEASE/gitea-$RELEASE-linux-amd64")
FILENAME="gitea-$RELEASE-linux-amd64"
curl -fsSL "https://github.com/go-gitea/gitea/releases/download/v$RELEASE/gitea-$RELEASE-linux-amd64" -o $FILENAME
systemctl stop gitea
rm -rf /usr/local/bin/gitea
mv gitea* /usr/local/bin/gitea
mv $FILENAME /usr/local/bin/gitea
chmod +x /usr/local/bin/gitea
systemctl start gitea
msg_ok "Updated $APP Successfully"