Skip to content

Commit

Permalink
Adjust curl behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
xlionjuan committed Nov 23, 2024
1 parent d27b5cf commit b4b5d22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rustdesk_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ REPO="rustdesk/rustdesk"
#API_URL="https://api.github.com/repos/$REPO/releases/tags/$TAG"
API_URL="https://api.github.com/repos/$REPO/releases/latest"
# Fetch the release data for the specified tag using curl
RELEASE_DATA=$(curl --retry 3 -s "$API_URL")
RELEASE_DATA=$(curl --retry 12 --retry-all-errors -s "$API_URL")

# Check if RELEASE_DATA is not empty
if [ -z "$RELEASE_DATA" ]; then
echo "Failed to fetch release data. Please check your internet connection or the repository/tag name."
# Check if RELEASE_DATA contains "browser_download_url"
if ! echo "$RELEASE_DATA" | grep -q "browser_download_url"; then
echo "'browser_download_url' not found in release data. Please check the repository/tag name or API response."
exit 1
fi

Expand Down
8 changes: 4 additions & 4 deletions rustdesk_nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ TAG="nightly" # Change this to any tag you want
API_URL="https://api.github.com/repos/$REPO/releases/tags/$TAG"
#API_URL="https://api.github.com/repos/$REPO/releases/latest"
# Fetch the release data for the specified tag using curl
RELEASE_DATA=$(curl --retry 3 -s "$API_URL")
RELEASE_DATA=$(curl --retry 12 --retry-all-errors -s "$API_URL")

# Check if RELEASE_DATA is not empty
if [ -z "$RELEASE_DATA" ]; then
echo "Failed to fetch release data. Please check your internet connection or the repository/tag name."
# Check if RELEASE_DATA contains "browser_download_url"
if ! echo "$RELEASE_DATA" | grep -q "browser_download_url"; then
echo "'browser_download_url' not found in release data. Please check the repository/tag name or API response."
exit 1
fi

Expand Down

0 comments on commit b4b5d22

Please sign in to comment.