diff --git a/Makefile b/Makefile index ef565d9..64c13f8 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,12 @@ install-script: install: ./install.sh install +.PHONY: uninstall +uninstall: install-script + ./install.sh uninstall + + + .PHONY: cli cli: go build -o ${CLI_BIN} -ldflags "-s -w" ./cli diff --git a/install.sh.in b/install.sh.in index 93d49e1..3c31fb8 100755 --- a/install.sh.in +++ b/install.sh.in @@ -27,11 +27,11 @@ if [ "$ARG1" == "install" ]; then notify-send "$msg" &> /dev/null || true elif [ "$ARG1" == "uninstall" ]; then - "${SUDO}" rm "@INSTALL_PREFIX@/bin/varnamcli" "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@" "@INSTALL_PREFIX@/lib/@LIB_NAME@" "@INSTALL_PREFIX@/lib/pkgconfig/govarnam.pc" - "${SUDO}" rm "@INSTALL_PREFIX@/include/libgovarnam/"* - "${SUDO}" rmdir "@INSTALL_PREFIX@/include/libgovarnam" - "${SUDO}" rm "@INSTALL_PREFIX@/share/varnam/schemes/"* - "${SUDO}" rmdir "@INSTALL_PREFIX@/share/varnam/schemes/" + "${SUDO}" rm -f "@INSTALL_PREFIX@/bin/varnamcli" "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@" "@INSTALL_PREFIX@/lib/@LIB_NAME@" "@INSTALL_PREFIX@/lib/pkgconfig/govarnam.pc" + "${SUDO}" rm -f "@INSTALL_PREFIX@/include/libgovarnam/"* + "${SUDO}" rmdir "@INSTALL_PREFIX@/include/libgovarnam" || true + "${SUDO}" rm -f "@INSTALL_PREFIX@/share/varnam/schemes/"* + "${SUDO}" rmdir "@INSTALL_PREFIX@/share/varnam/schemes/" || true msg="Uninstallation finished" echo $msg