install script: fix premature exit?
This commit is contained in:
parent
23252e5b28
commit
6445135cfe
1 changed files with 10 additions and 8 deletions
|
@ -29,14 +29,16 @@ if ! dot checkout > /dev/null 2>&1; then
|
||||||
mkdir -p "$DOTFILES_BACKUP_DIR"
|
mkdir -p "$DOTFILES_BACKUP_DIR"
|
||||||
|
|
||||||
# get the list of files that need to be backed up
|
# get the list of files that need to be backed up
|
||||||
dot checkout 2>&1 \
|
if ! dot checkout 2>&1 \
|
||||||
| grep -Po '\t\K.*$' \
|
| grep -Po '\t\K.*$' \
|
||||||
| while read -r LINE; do
|
| while read -r LINE; do
|
||||||
LINE_DIR="$(dirname "$LINE")" # No file
|
LINE_DIR="$(dirname "$LINE")" # No file
|
||||||
[ "$LINE_DIR" = '.' ] || [ "$LINE_DIR" = '..' ] && continue
|
[ "$LINE_DIR" = '.' ] || [ "$LINE_DIR" = '..' ] && continue
|
||||||
mkdir -p "$DOTFILES_BACKUP_DIR/$LINE_DIR"
|
mkdir -p "$DOTFILES_BACKUP_DIR/$LINE_DIR"
|
||||||
mv "$HOME/$LINE" "$DOTFILES_BACKUP_DIR/$LINE_DIR"
|
mv "$HOME/$LINE" "$DOTFILES_BACKUP_DIR/$LINE_DIR"
|
||||||
done
|
done
|
||||||
|
then echo " Backup complete"
|
||||||
|
fi
|
||||||
|
|
||||||
# now that all the files are out of the way, we can do one final checkout
|
# now that all the files are out of the way, we can do one final checkout
|
||||||
dot checkout
|
dot checkout
|
||||||
|
|
Loading…
Add table
Reference in a new issue