-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstaller.sh
76 lines (69 loc) · 2.59 KB
/
uninstaller.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
welcome_uninstaller() {
echo "
╔═══════════════════════════════════════╗
║ ║
║ ~ GitSyncMaster ~ ║
║ Developed with ❤️ by ║
║ Felipe Alfonso González L. ║
║ Computer Science Engineer ║
║ Chile ║
║ ║
║ Contact: [email protected] ║
║ Licensed under BSD 3-clause ║
║ GitHub: github.com/felipealfonsog ║
║ ║
╚═══════════════════════════════════════╝
"
echo "Welcome to the GitHub Repository Updater -GitSyncMaster- uninstaller!"
echo "---------------------------------------------------------------------"
}
remove_exec_file() {
if [[ $(uname) == "Darwin" ]]; then
if [[ -f /usr/local/bin/gitsync ]]; then
sudo rm /usr/local/bin/gitsync
echo "Removed /usr/local/bin/gitsync"
fi
else
if [[ -f /usr/bin/gitsync ]]; then
sudo rm /usr/bin/gitsync
echo "Removed /usr/bin/gitsync"
elif [[ -f /usr/local/bin/gitsync ]]; then
sudo rm /usr/local/bin/gitsync
echo "Removed /usr/local/bin/gitsync"
fi
fi
}
remove_path_configuration() {
if [[ $(uname) == "Darwin" ]]; then
sed -i '' '/export PATH="\/usr\/local\/bin:$PATH"/d' ~/.bash_profile
source ~/.bash_profile
else
if [[ -f ~/.bashrc ]]; then
sed -i '/export PATH="\/usr\/local\/bin:$PATH"/d' ~/.bashrc
source ~/.bashrc
elif [[ -f ~/.bash_profile ]]; then
sed -i '/export PATH="\/usr\/local\/bin:$PATH"/d' ~/.bash_profile
source ~/.bash_profile
else
sed -i '/export PATH="\/usr\/local\/bin:$PATH"/d' ~/.profile
source ~/.profile
fi
fi
}
cleanup() {
if [[ -f "$source_file_name" ]]; then
rm "$source_file_name"
echo "Downloaded file '$source_file_name' has been deleted."
fi
}
main() {
welcome_uninstaller
remove_exec_file
remove_path_configuration
cleanup
echo "-------------------------------------------------------------------"
echo "GitSyncMaster has been uninstalled successfully."
echo "-------------------------------------------------------------------"
}
main