-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaller.sh
More file actions
54 lines (44 loc) · 786 Bytes
/
installer.sh
File metadata and controls
54 lines (44 loc) · 786 Bytes
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
readonly DIR="/usr/bin"
installation() {
echo "Installing Ufetch..."
echo "Building..."
cargo build --release
echo "Copying Files..."
sudo cp target/release/ufetch ${DIR}/ufetch
echo "Installation Done!"
}
uninstallation() {
echo "Removing Files..."
sudo rm ${DIR}/ufetch
echo "Uninstallation Done"
}
installation_prompt() {
while true; do
read -r -p "Install ufetch? [Y/N] " yn
case $yn in
[Yy]*)
installation
break
;;
[Nn]*) break ;;
esac
done
}
main() {
if test -f "${DIR}/ufetch"; then
while true; do
read -r -p "Found existing installation. Do you want to uninstall it? [Y/N] " yn
case $yn in
[Yy]*)
uninstallation
installation_prompt
exit
;;
[Nn]*) exit ;;
esac
done
fi
installation
}
main