diff options
Diffstat (limited to 'infection')
-rwxr-xr-x | infection | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -32,14 +32,16 @@ function infection_init { # # This way we can easily check the integrity of our dotfiles # once the integrity of the apps repo is checked - if [ -e "$HOME/.dotfiles" ]; then - if [ ! -h "$HOME/.dotfiles" ] || [ "`readlink $HOME/.dotfiles`" != "apps/dotfiles" ]; then - mkdir -p $BACKUPS - mv $HOME/.dotfiles $BACKUPS/ - ( cd $HOME &> /dev/null && ln -s apps/dotfiles .dotfiles ) + if [ -e "$HOME/apps/dotfiles" ]; then + if [ -e "$HOME/.dotfiles" ]; then + if [ ! -h "$HOME/.dotfiles" ] || [ "`readlink $HOME/.dotfiles`" != "apps/dotfiles" ]; then + mkdir -p $BACKUPS + mv $HOME/.dotfiles $BACKUPS/ + ( cd $HOME &> /dev/null && ln -s apps/dotfiles .dotfiles ) + fi + else + ( cd $HOME &> /dev/null && ln -s apps/dotfiles .dotfiles ) fi - else - ( cd $HOME &> /dev/null && ln -s apps/dotfiles .dotfiles ) fi #if [ ! -e "$HOME/.dotfiles" ]; then |