Skip to content

Instantly share code, notes, and snippets.

@Fred-Barclay
Forked from nihilismus/atom-beta-update.sh
Created April 19, 2016 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fred-Barclay/d2502504a827a5097cbde7aa41faadb2 to your computer and use it in GitHub Desktop.
Save Fred-Barclay/d2502504a827a5097cbde7aa41faadb2 to your computer and use it in GitHub Desktop.
atom-beta-update.sh: download & install in openSUSE the latest Beta version of Atom from GitHub
#!/bin/sh
# atom-beta-update.sh: download & install in openSUSE the latest Beta version
# of Atom from GitHub: https://atom.io/beta
# Copyright © 2016 Antonio Hernández Blas <hba.nihilismus@gmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
TMP_DIR="/root/.atom-releases"
github_server="https://github.com"
github_releases="https://github.com/atom/atom/releases"
last_release="$(wget -o /dev/null -O - ${github_releases} | \
grep -E '.*releases.*download.*beta.*x86_64.rpm.*' | \
sed 's/^.*ref="//' | \
sed 's/x86_64.rpm.*$/x86_64.rpm/' | \
grep -E 'atom.x86_64.rpm$' | \
head -1 )"
mkdir -p $TMP_DIR
cd $TMP_DIR
chown -R root:root .
rm -f atom.x86_64.rpm wget.log
echo
echo " => Downloading ${github_server}/${last_release}"
echo
sleep 3
wget "${github_server}/${last_release}" -O atom.x86_64.rpm -o - | tee wget.log
echo
echo " => Installing atom.x86_64.rpm"
echo
zypper install atom.x86_64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment