Created
February 7, 2017 09:37
-
-
Save koter84/4b00298b8adf0d6c57a5f035a1affb7a to your computer and use it in GitHub Desktop.
Updater for Gnome Shell Extension TopIcons-Plus
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 | |
# check version | |
prog_dir_version=$(grep \"version\" ~/.local/share/gnome-shell/extensions/[email protected]/metadata.json | awk '{ print $2 }' | sed s/,//g) | |
echo "DIR Version: $prog_dir_version" | |
prog_url="https://raw.githubusercontent.com/phocean/TopIcons-plus/master/metadata.json" | |
prog_url_version=$(curl -s $prog_url | grep \"version\" | awk '{ print $2 }' | sed s/,//g) | |
echo "URL Version: $prog_url_version" | |
# check that a current version is found | |
if [ "$prog_dir_version" == "" ] | |
then | |
echo "New Installation! (no old version found)" | |
new_install="1" | |
fi | |
# check that a new version and url are found | |
if [ "$prog_url" == "" ] || [ "$prog_url_version" == "" ] | |
then | |
echo "couldn't find url for new version" | |
exit | |
fi | |
# check current dir version with current url version | |
if [ "$prog_dir_version" != "$prog_url_version" ] | |
then | |
if [ "$new_install" != "1" ] | |
then | |
echo "New Version Found!" | |
fi | |
if [ -d /tmp/topiconsplus ] | |
then | |
rm -rf /tmp/topiconsplus | |
fi | |
mkdir /tmp/topiconsplus | |
cd /tmp/topiconsplus/ | |
git clone [email protected]:phocean/TopIcons-plus.git | |
cd TopIcons-plus | |
make | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment