-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
47 lines (40 loc) · 811 Bytes
/
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
#!/bin/bash
user=$(whoami)
file=user_starship.toml
function copiaFile(){
echo "Copiando en..."
echo "~/.config"
cp $file $HOME/.config/starship.toml
}
function compDir(){
if [ -d ~/.config ]
then
copiaFile
else
echo "No existe el directorio destino ~/.config"
echo "Deseas crearlo y copiar el fichero en él? (s/n)"
read resp
if [ $resp == 's']
then
echo "Creando directorio..."
mkdir ~/.config
copiaFile
else
echo "Saliendo."
exit 0
fi
fi
}
echo "Instalación del fichero de configuración."
echo ""
if [ "$EUID" -ne 0 ]
then
echo "Para instalarlo en el usuario root, eleva privilegios: p.ej. [sudo -s]"
echo "Instalando el fichero de configuración para el usuario: " $user
echo ""
compDir
exit 0
else
file=root_starship.toml
compDir
fi