Strip 'v' prefix from RELEASE in Guardian installation scripts for consistent folder naming

This commit is contained in:
Vincent 2025-09-30 14:51:54 -04:00
parent bf38566ff8
commit c520602fcb
2 changed files with 6 additions and 2 deletions

View File

@ -49,7 +49,9 @@ function update_script() {
curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${RELEASE}.zip" curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip" unzip -q "${RELEASE}.zip"
rm -rf /opt/Guardian rm -rf /opt/Guardian
mv "Guardian-${RELEASE}/" "/opt/Guardian" # Strip 'v' prefix from RELEASE for folder name
FOLDER_NAME=$(echo "${RELEASE}" | sed 's/^v//')
mv "Guardian-${FOLDER_NAME}/" "/opt/Guardian"
# Build Backend # Build Backend
cd /opt/Guardian/backend cd /opt/Guardian/backend

View File

@ -30,7 +30,9 @@ msg_info "Setup Guardian"
RELEASE=$(curl -fsSL https://api.github.com/repos/HydroshieldMKII/Guardian/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -fsSL https://api.github.com/repos/HydroshieldMKII/Guardian/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${RELEASE}.zip" curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip" unzip -q "${RELEASE}.zip"
mv "Guardian-${RELEASE}/" "/opt/Guardian" # Strip 'v' prefix from RELEASE for folder name
FOLDER_NAME=$(echo "${RELEASE}" | sed 's/^v//')
mv "Guardian-${FOLDER_NAME}/" "/opt/Guardian"
echo "${RELEASE}" >/opt/Guardian_version.txt echo "${RELEASE}" >/opt/Guardian_version.txt
msg_ok "Setup Guardian" msg_ok "Setup Guardian"