Merge pull request #2147 from davidpfarrell/dirs-bks

plugin(dirs): Create backup file parent directory
pull/2081/merge
Noah Gorny 2022-05-19 00:01:58 +03:00 committed by GitHub
commit 03b3a977aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -63,12 +63,15 @@ function dirs-help() {
if [[ -f "${BASH_IT_DIRS_BKS?}" ]]; then if [[ -f "${BASH_IT_DIRS_BKS?}" ]]; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "${BASH_IT_DIRS_BKS?}" source "${BASH_IT_DIRS_BKS?}"
elif [[ -f ~/.dirs ]]; then else
mkdir -p "${BASH_IT_DIRS_BKS%/*}"
if [[ -f ~/.dirs ]]; then
mv -vn ~/.dirs "${BASH_IT_DIRS_BKS?}" mv -vn ~/.dirs "${BASH_IT_DIRS_BKS?}"
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "${BASH_IT_DIRS_BKS?}" source "${BASH_IT_DIRS_BKS?}"
else else
touch "${BASH_IT_DIRS_BKS?}" touch "${BASH_IT_DIRS_BKS?}"
fi
fi fi
alias L='cat "${BASH_IT_DIRS_BKS?}"' alias L='cat "${BASH_IT_DIRS_BKS?}"'