File: uninstall.sh

package info (click to toggle)
imsprog 1.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,828 kB
  • sloc: cpp: 6,525; ansic: 5,899; xml: 552; sh: 231; makefile: 5
file content (51 lines) | stat: -rwxr-xr-x 1,799 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/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_editor.desktop"
    "${CMAKE_INSTALL_PREFIX}/share/applications/IMSProg.desktop"
    "${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