-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathremove_iTerm.sh
54 lines (42 loc) Β· 996 Bytes
/
remove_iTerm.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
#!/bin/bash
# This program will remove the various iTerm app names to do a clean update
#################
### Variables ###
#################
# Items at the system level to be removed
systemItems=(
/Applications/iTerm.app
# Following .apps represent the variety of iTerm app names on THD machines based on a search -ek
/Applications/iTerm\ 2.app
/Applications/iTerm-2.app
/Applications/iTerm\ 3.app
/Applications/iTerm\ \(3.0.4\).app
/Applications/iTerm\ \(3.0.9\).app
/Applications/iTerm29.app
)
#################
### Functions ###
#################
function deleteItems()
{
declare -a toDelete=("${!1}")
for item in "${toDelete[@]}"
do
if [[ ! -z "${2}" ]]
then
item=("${2}""${item}")
fi
echo "Looking for $item"
if [ -e "${item}" ]
then
echo "Removing $item"
rm -rf "${item}"
fi
done
}
####################
### Main Program ###
####################
# Delete system level items
deleteItems systemItems[@]
exit 0