From 3b0276f01cfd873cc652afe1e7579c0a96dcb0bf Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 16 Aug 2021 11:36:27 -0700 Subject: [PATCH] Fix: breakage when mkdir is not given a folder name --- .local/bin/dotfiles-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dotfiles-install.sh b/.local/bin/dotfiles-install.sh index ddc3210..485522e 100755 --- a/.local/bin/dotfiles-install.sh +++ b/.local/bin/dotfiles-install.sh @@ -28,7 +28,7 @@ else # get the list of files that need to be backed up DOTFILES_BACKUP_LIST=($(dot checkout 2>&1 | grep -Po "\t.*$" | cut -c 1 --complement)) # create directories for everything that needs one - mkdir -p $(printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | grep -Po '.*/' | sed "s#.*#$DOTFILES_BACKUP_DIR/&#g") + 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 printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | xargs -I{} mv "$HOME"/{} "$DOTFILES_BACKUP_DIR"/{} fi