Skip to content

Commit

Permalink
fix how LATEST_VERSION is determined
Browse files Browse the repository at this point in the history
  • Loading branch information
tjluoma committed Jun 10, 2019
1 parent c6013a3 commit 2bc2be6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion di-githubdesktop.sh
Expand Up @@ -28,12 +28,15 @@ fi
# note: this is very much _not_ a Sparkle feed
XML_FEED='https://github.com/desktop/desktop/releases.atom'

LATEST_VERSION=$(curl -sfLS "$XML_FEED" | awk -F'release-|>|<' '/<title>release/{print $4}' | fgrep -iv 'beta' | head -1)
## 2019-06-10 no longer works to get version
# LATEST_VERSION=$(curl -sfLS "$XML_FEED" | awk -F'release-|>|<' '/<title>release/{print $4}' | fgrep -iv 'beta' | head -1)

URL=$(curl -sSfL --head "https://central.github.com/deployments/desktop/desktop/latest/darwin" \
| awk -F' |\r' '/^.ocation:/{print $2}' \
| tail -1)

LATEST_VERSION=$(echo "$URL" | sed 's#.*/releases/##g ; s#/GitHubDesktop.zip##g ; s#-.*##g')

# If either of these are blank, we cannot continue
if [ "$URL" = "" -o "$LATEST_VERSION" = "" ]
then
Expand Down

0 comments on commit 2bc2be6

Please sign in to comment.