Merge pull request #2147 from davidpfarrell/dirs-bks

plugin(dirs): Create backup file parent directory
This commit is contained in:
Noah Gorny
2022-05-19 00:01:58 +03:00
committed by GitHub

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
mv -vn ~/.dirs "${BASH_IT_DIRS_BKS?}"
# shellcheck disable=SC1090
source "${BASH_IT_DIRS_BKS?}"
else else
touch "${BASH_IT_DIRS_BKS?}" mkdir -p "${BASH_IT_DIRS_BKS%/*}"
if [[ -f ~/.dirs ]]; then
mv -vn ~/.dirs "${BASH_IT_DIRS_BKS?}"
# shellcheck disable=SC1090
source "${BASH_IT_DIRS_BKS?}"
else
touch "${BASH_IT_DIRS_BKS?}"
fi
fi fi
alias L='cat "${BASH_IT_DIRS_BKS?}"' alias L='cat "${BASH_IT_DIRS_BKS?}"'