Skip to content

Instantly share code, notes, and snippets.

@tyjak
Last active March 13, 2021 16:07
Show Gist options
  • Save tyjak/58d0769588db7a673c5a66843c3cc6db to your computer and use it in GitHub Desktop.
Save tyjak/58d0769588db7a673c5a66843c3cc6db to your computer and use it in GitHub Desktop.
Update binance app and AUR pkg
#!/bin/zsh
#
# Script to update binance app + aur package
#
# GistID:58d0769588db7a673c5a66843c3cc6db
echo "Loading Binance binary"
curl -sO https://ftp.binance.com/electron-desktop/linux/production/binance-amd64-linux-deb.deb
echo "Check sha256sum..."
[ "$(sha256sum binance-amd64-linux.deb | cut -d' ' -f1)" = "$(curl -s https://ftp.binance.com/electron-desktop/linux/production/binance-amd64-linux-deb-sha256.txt)" ] && \
echo "Update PKGBUILD sha256dum" && \
updpkgsums && \
echo "Mise à jour..." && \
makepkg -si && \
echo "Maj num version PKGBUILD" && \
VERSION=$(gunzip -cd src/usr/share/doc/binance/changelog.gz | head -1 | sed -e "s/^binance (\([0-9.]\+\)).*$/\1/") && \
sed -i PKGBUILD -e "s/^pkgver=\([0-9.]\+\)/pkgver=${VERSION}/" && \
echo "generation .SRCINFO" && \
makepkg --printsrcinfo > .SRCINFO && \
echo "commit and push to aur repo" && \
git add PKGBUILD .SRCINFO && \
git commit -m "Update to version $VERSION" && \
git push \
|| echo "something failed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment