You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit replays the PR of @mablrjorcelinojunior#15
and fixes the version fetchting problem.
Additional changes:
* Move AppImage to $HOME/Applications
* Bump gum version to 0.16.0
logg error "$(echo -e "Failed to fetch headers from the server.\n • Ensure your internet connection is active and stable.\n • Ensure that 'VERSION_CHECK_TIMEOUT' ($VERSION_CHECK_TIMEOUT sec) is set high enough to retrieve the headers.\n • Also, verify if 'DOWNLOAD_URL' is correct: $DOWNLOAD_URL.\n\n ")"
173
+
local api_response
174
+
if! api_response=$(spinner "Fetching version info from the API..." \
logg error "$(echo -e "Failed to fetch data from the API server.\n • Ensure your internet connection is active and stable.\n • Ensure that 'VERSION_CHECK_TIMEOUT' ($VERSION_CHECK_TIMEOUT sec) is set high enough.\n • Also, verify if 'API_URL' is correct: $API_URL.\n\n ")"
177
+
return 1
178
+
fi
179
+
if!command -v jq &> /dev/null;then
180
+
logg error "jq is required to parse JSON response but it's not installed. Please install jq and try again."
logg error "$(echo -e "Failed to fetch file details from the download server.\n • Ensure your internet connection is active and stable.\n • Check if the download URL is accessible: $download_url\n\n ")"
194
+
return 1
195
+
fi
196
+
remote_name=$(basename "$download_url")
180
197
remote_size=$(echo "$headers"| grep -oE 'Content-Length: [0-9]+'| sed 's/Content-Length: //')|| remote_size="0"
181
198
remote_version=$(extract_version "$remote_name")
182
-
remote_md5=$(echo "$headers"| grep -oE 'ETag: "[^"]+"'| sed 's/ETag: //; s/"//g'||echo"unknown")
199
+
remote_hash=$(echo "$headers"| grep -oE 'ETag: "[^"]+"'| sed 's/ETag: //; s/"//g'||echo"unknown")
183
200
if [[ -z"$remote_name" ]];then
184
-
logg error "Could not fetch the filename info. Please check that the 'DOWNLOAD_URL' variable is correct and try again."
201
+
logg error "Could not determine the filename from download URL. Please check the API response and try again."
0 commit comments