diff --git a/ct/guardian.sh b/ct/guardian.sh index b3c4634b..140a472a 100644 --- a/ct/guardian.sh +++ b/ct/guardian.sh @@ -49,7 +49,9 @@ function update_script() { curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" 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 cd /opt/Guardian/backend diff --git a/install/guardian-install.sh b/install/guardian-install.sh index 69eeecf3..51b67744 100644 --- a/install/guardian-install.sh +++ b/install/guardian-install.sh @@ -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) }') curl -fsSL -o "${RELEASE}.zip" "https://github.com/HydroshieldMKII/Guardian/archive/refs/tags/${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 msg_ok "Setup Guardian"