diff --git a/tforgione.sh b/tforgione.sh index b190ef7..353b626 100755 --- a/tforgione.sh +++ b/tforgione.sh @@ -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 }