diegoferigo/dotfiles

Restore original dotfiles when bootstrapping fails

Opened this issue · 0 comments

Sometimes it happens that, due to updates of resources used during the bootstrapping process or other unpredictable problems, initialization fails.

The process already backs up the existing files into ~/.dotfiles_backup, but in case of failures it does not restore the original resources.

dotfiles/bootstrap

Lines 63 to 65 in 70a9339

echo "==> Initializing dotfiles"
BACKUP_DIR=${BACKUP_DIR:-$HOME/.dotfiles_backup}
(config checkout &>/dev/null || (backup ${BACKUP_DIR} && config checkout)) || (echo "==> failed" && exit 1)