#!/bin/bash

set -o nounset

if [ "$EUID" -ne 0 ]
then
	echo "Please run as root"
	echo "E.g.:"
	echo "$ sudo $0"
	exit 1
fi

for link in applications/GitWorks.desktop \
	    icons/GitWorks.svg \
	    icons/GitWorks.png
do
	path=/usr/local/share/$link
	if [ -L "$path" ]; then
		rm $path || exit 1
	fi
done
rm -r /opt/GitWorks || exit 1

echo "Uninstallation of GitWorks successful"
