Skip to content

Commit

Permalink
fixing regex for latest version (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudev authored and olafurpg committed Dec 19, 2016
1 parent d3268f1 commit b5f633a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/scalafmt_auto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CURL=$(which curl)
TAR=$(which tar)
JAVA=$(which java)
GREP=$(which grep)
CUT=$(which cut)

check_binary "$CURL"
check_binary "$TAR"
Expand All @@ -25,7 +26,7 @@ check_binary "$GREP"

check_latest () {
echo "Checking latest version from github..."
latest_version=$($CURL -s https://api.github.com/repos/olafurpg/scalafmt/releases/latest | $GREP -Eo '"tag_name":(.*)' | $GREP -Eo 'v[0-9\.]+')
latest_version=$($CURL -s https://api.github.com/repos/olafurpg/scalafmt/releases/latest | $GREP -Eo '"tag_name":(.*)' | $CUT -d \" -f 4)
if [[ $latest_version = "" ]]; then
echo "The github call failed, either because of an internet connection issue or rate limits..."
exit 1
Expand Down

0 comments on commit b5f633a

Please sign in to comment.