-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·52 lines (48 loc) · 1.48 KB
/
install.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
#!/usr/bin/env bash
anisay_config_folder=~/.config/anisay
if [ "$1" == "-h" ] ; then
echo "$0 usage:
-------------------
-h show this help menu
-r remove anisay and configs
-u update anisay and configs"
exit 0
elif [ "$1" == "-r" ] ; then
echo "removing anisay..."
rm -f $HOME/.local/bin/anisay && echo "done"
echo "Remove $HOME/.config/anisay files? y/n"
read -r userprompt
if [ $userprompt == "y" ] ; then
rm -rf $HOME/.config/anisay
echo "removed config files"
fi
exit 0
elif [ "$1" == "-u" ] ; then
installed=$(command -v anisay)
if [ -z $installed ] ; then
echo "anisay is not installed yet"
fi
chmod +x anisay
cp -f anisay $HOME/.local/bin/ && echo 'updated anisay in $HOME/.local/bin/anisay'
echo "Also update $HOME/.config/anisay files? y/n"
read -r userprompt
if [ $userprompt == "y" ] ; then
mkdir -p $anisay_config_folder/ascii
cp -f -r ascii/* $anisay_config_folder/ascii && echo "Copied resources to $anisay_config_folder"
exit 0
fi
fi
installed=$(command -v anisay)
if [ -z $installed ] ; then
chmod +x anisay
mkdir -p $HOME/.local/bin/
cp -f anisay $HOME/.local/bin/ && echo 'Copied anisay to $HOME/.local/bin/anisay'
else
echo -en "install.sh: anisay already installed\n"
echo -n "install.sh: use the '-r' flag to remove or the '-u' flag to update"
fi
if [ ! -d $anisay_config_folder ] ; then
mkdir -p $anisay_config_folder/ascii
chmod +x ascii/test.sh
cp -f -r ascii/* $anisay_config_folder/ascii && echo "Copied resources to $anisay_config_folder"
fi