Created
July 26, 2017 15:42
-
-
Save heyost/20c216a287067073ee816913ae200775 to your computer and use it in GitHub Desktop.
Simple script to check new version of Atom on Fedora
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source - https://fedoraproject.org/wiki/Atom | |
ATOM_INSTALLED_VERSION=$(rpm -qi atom | grep "Version" | cut -d ':' -f 2 | cut -d ' '$ | |
ATOM_LATEST_VERSION=$(curl -sL "https://api.github.com/repos/atom/atom/releases/latest$ | |
echo Installed version: $ATOM_INSTALLED_VERSION | |
echo Latest version: $ATOM_LATEST_VERSION | |
echo ------------------------------------ | |
if [[ $ATOM_INSTALLED_VERSION < $ATOM_LATEST_VERSION ]]; then | |
echo New version available | |
read -p "Do you want install latest version? " -n 1 -r | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
sudo dnf install -y https://github.com/atom/atom/releases/download/v${ATOM_LATES$ | |
fi | |
else | |
echo Yay! you already on new version | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment