This commit is contained in:
Thomas Forgione 2019-01-09 11:47:01 +01:00
parent 78889ae464
commit deca83b4b3
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 12 additions and 20 deletions

View File

@ -94,38 +94,31 @@ configure_zsh() {
install zsh
fi
mkdir -p $home/.config
if [ ! -d $home/.config/oh-my-zsh ]; then
git_clone https://github.com/robbyrussell/oh-my-zsh/ $home/.config/oh-my-zsh
mkdir -p $HOME/.config
if [ ! -d $HOME/.config/oh-my-zsh ]; then
git_clone https://github.com/robbyrussell/oh-my-zsh/ $HOME/.config/oh-my-zsh
fi
if [ ! -d $home/.config/dotfiles ]; then
git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $home/.config/dotfiles
if [ ! -d $HOME/.config/dotfiles ]; then
git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $HOME/.config/dotfiles
fi
if [ ! -d $home/.scripts ]; then
yes_no_ask "You don't have tforgione's scripts, do you want them ?"
if [ $? -eq 0 ]; then
git_clone https://gitea.tforgione.fr/tforgione/scripts $home/.scripts
fi
fi
if [ -f $home/.zshrc ]; then
path1=`realpath $home/.zshrc`
path2=`realpath $home/.config/dotfiles/zshrc`
if [ -f $HOME/.zshrc ]; then
path1=`realpath $HOME/.zshrc`
path2=`realpath $HOME/.config/dotfiles/zshrc`
if [ "$path1" == "$path2" ]; then
echo_green "It seems that your zshrc is already a good link."
else
if `realpath $home/.zshrc`; then
if `realpath $HOME/.zshrc`; then
echo_green Warning: you already have a zshrc, it will be moved to ~/.zshrc.bak
mv $home/.zshrc $home/.zshrc.bak
mv $HOME/.zshrc $HOME/.zshrc.bak
fi
echo_green Linking zshrc
ln -s $home/.config/dotfiles/zshrc $home/.zshrc
ln -s $HOME/.config/dotfiles/zshrc $HOME/.zshrc
fi
else
echo_green Linking zshrc
ln -s $home/.config/dotfiles/zshrc $home/.zshrc
ln -s $HOME/.config/dotfiles/zshrc $HOME/.zshrc
fi
if [ "$user_shell" == "/bin/zsh" ]; then
@ -143,7 +136,6 @@ configure_zsh() {
}
main() {
echo_green "=== WELCOME TO TFORGIONE'S CONFIG INSTALLER ==="
configure_zsh
}