-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathuninstall.sh
executable file
·50 lines (41 loc) · 1.09 KB
/
uninstall.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
#!/bin/sh
if ! command -v nox >/dev/null 2>&1; then
echo "[nox] nox is not installed."
exit 1
fi
read -r -p "[nox] are you sure you want to uninstall nox? [y/N]" confirmation
if [ "$confirmation" != y ] && [ "$confirmation" != Y ]; then
echo "[nox] uninstall cancelled"
exit
fi
if [[ -z $NOX_NAME ]]; then
echo "[nox] nox environment variables is not initialized. Please check if you have executed \`source ~/.zshrc\`"
exit 1
fi
source $NOX_COMMON/dependency.sh
unregister_nox_dependency
_TARGET="/usr/local/bin"
_TARGET_NOX="${_TARGET}/${NOX_NAME}"
if [[ -e $_TARGET_NOX ]]; then
if [[ `arch` == "arm64" ]]; then
sudo rm $_TARGET_NOX
else
rm $_TARGET_NOX
fi
fi
if [[ -e .noxrc ]]; then
rm .noxrc
fi
sed -i '' '/.noxrc/d' ~/.zshrc
source $NOX_COMMON/logo.sh
source $NOX_COMMON/utils.sh
# Uninstall success
success ""
success ""
print_colorful_logo
success " ... is now uninstall!"
success ""
success " Thanks for trying out nox."
success " Byeeeeeee!"
success ""
success ""