Skip to content

Instantly share code, notes, and snippets.

@alswl
Created January 8, 2018 07:38
Show Gist options
  • Save alswl/c52e4b448f8e37c125882558b19620fb to your computer and use it in GitHub Desktop.
Save alswl/c52e4b448f8e37c125882558b19620fb to your computer and use it in GitHub Desktop.
brew cask cctalk
XML_URL=`c Casks/cctalk.rb G appcast | awk -F "'" '{print $2}'`
XML_SHA256=`curl -s $XML_URL | gsha256sum`
PUBDATE=`curl -s $XML_URL | xmlstarlet sel -t -v '//pubDate' | awk '{print $1}'`
VERSION=`curl -s $XML_URL | xmlstarlet sel -t -v '//title' | awk '{print $2}'`
BUILD=`curl -s $XML_URL | xmlstarlet sel -t -v '//sparkle:version'`
VERSION_ALL="$VERSION-$BUILD,$PUBDATE"
sed -i "s/version .*/version '$VERSION_ALL'/" Casks/cctalk.rb
sed -i "s/sha256 .*/sha256 ''/" Casks/cctalk.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment