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