From c734e18eda99cf9b51b1488196c76c4beaad6b23 Mon Sep 17 00:00:00 2001 From: LukeZGD <26163116+LukeZGD@users.noreply.github.com> Date: Sun, 2 Jul 2023 16:55:16 +0800 Subject: [PATCH] Fix version update --- restore.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/restore.sh b/restore.sh index 7d74b48..2bafa0e 100755 --- a/restore.sh +++ b/restore.sh @@ -413,12 +413,14 @@ version_update() { else req=".assets[] | select (.name|test(\"${platform}\")) | .browser_download_url" fi + pushd "$(dirname "$0")/tmp" >/dev/null url="$(echo "$github_api" | $jq -r "$req")" log "Downloading: $url" - curl -L $url -o tmp/latest.zip - if [[ ! -s tmp/latest.zip ]]; then + curl -L $url -o latest.zip + if [[ ! -s latest.zip ]]; then error "Download failed. Please run the script again" fi + popd >/dev/null log "Updating..." cp resources/firstrun tmp 2>/dev/null rm -r bin/ resources/ LICENSE README.md restore.cmd restore.sh