From 244939b28c48de66ac71580dd1160475ea89631d Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 8 Apr 2022 13:49:06 -0700 Subject: [PATCH] minor update to dotfiles-install.sh --- .local/bin/dotfiles-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/dotfiles-install.sh b/.local/bin/dotfiles-install.sh index f548f75..0028d69 100755 --- a/.local/bin/dotfiles-install.sh +++ b/.local/bin/dotfiles-install.sh @@ -2,7 +2,7 @@ # this script will install the dotfiles from the target git repository, and back up any conflicting files # credit for this idea and basic script outline goes to https://www.atlassian.com/git/tutorials/dotfiles -# TODO: make it so like 31 (DOTFILES_BACKUP_LIST) can handle spaces +# TODO: make it so line 31 (DOTFILES_BACKUP_LIST) can handle spaces (do it in a for loop) DOTFILES_REPO_DIR="$HOME/git/dotfiles" DOTFILES_REPO_URL="https://git.blakenorth.net/dotfiles" @@ -31,7 +31,7 @@ else DOTFILES_BACKUP_LIST=($(dot checkout 2>&1 | grep -Po "(?<=\t)(.*)$")) # create directories for everything that needs one mkdir -p "$DOTFILES_BACKUP_DIR" $(printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | grep -Po '.*/' | sed "s#.*#$DOTFILES_BACKUP_DIR/&#g") - # backup the files to avoid them being overwritten + # backup existing files to avoid them being overwritten printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | xargs -I{} mv "$HOME"/{} "$DOTFILES_BACKUP_DIR"/{} fi