Skip to content

Commit

Permalink
Merge pull request #114 from asamahy/uninstaller
Browse files Browse the repository at this point in the history
feat: Uninstaller Script
  • Loading branch information
bigbigmdm authored Sep 17, 2024
2 parents 5349780 + ae29e87 commit eead6be
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

bold=$(tput bold)
normal=$(tput sgr0)
files=()

if [[ "$OSTYPE" == "darwin"* ]]; then
CMAKE_INSTALL_PREFIX='/usr/local'
files+=(
"/Applications/IMSProg.app"
"/Applications/IMSProg Database Update.app"
"/Applications/IMSProg Editor.app")
else
CMAKE_INSTALL_PREFIX='/usr'
fi

files+=(
"${CMAKE_INSTALL_PREFIX}/bin/IMSProg"
"${CMAKE_INSTALL_PREFIX}/share/pixmaps"
"${CMAKE_INSTALL_PREFIX}/share/imsprog"
"${CMAKE_INSTALL_PREFIX}/share/doc/imsprog"
"${CMAKE_INSTALL_PREFIX}/bin/IMSProg_database_update"
"${CMAKE_INSTALL_PREFIX}/share/applications/IMSProg_database_update.desktop"
"${CMAKE_INSTALL_PREFIX}/share/man/man1/IMSProg.1.gz"
"${CMAKE_INSTALL_PREFIX}/share/man/man1/IMSProg_database_update.1.gz"
"${CMAKE_INSTALL_PREFIX}/share/metainfo/io.github.bigbigmdm.imsprog.metainfo.xml"
"${CMAKE_INSTALL_PREFIX}/share/metainfo/io.github.bigbigmdm.imsprog_database_update.metainfo.xml"
"${CMAKE_INSTALL_PREFIX}/bin/IMSProg_editor"
"${CMAKE_INSTALL_PREFIX}/share/man/man1/IMSProg_editor.1.gz"
"${CMAKE_INSTALL_PREFIX}/share/metainfo/io.github.bigbigmdm.imsprog_editor.metainfo.xml"
"${HOME}/.local/share/imsprog")

echo "${bold}Warning: This script will permanently delete the following files and directories:${normal}"

for file in "${files[@]}"; do
echo "${bold}\"$file\"${normal}"
done

read -rp "Are you sure you want to proceed? (Y/n): " confirm
confirm=${confirm:-y}

if [[ $confirm != "y" && $confirm != "Y" ]]; then
echo "Operation Canceled."
exit 1
fi

for file in "${files[@]}"; do
sudo rm -rf "$file"
done && echo Uninstall Complete

0 comments on commit eead6be

Please sign in to comment.