aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/keep.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/keep.bash')
-rw-r--r--bash/bashrc.d/keep.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash
index 6796aae7..26a84f5b 100644
--- a/bash/bashrc.d/keep.bash
+++ b/bash/bashrc.d/keep.bash
@@ -29,7 +29,7 @@ keep() {
# Figure out the directory to which we're reading and writing these scripts
local bashkeep
- bashkeep=${BASHKEEP:-"$HOME"/.bashkeep.d}
+ bashkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/bashkeep
mkdir -p -- "$bashkeep" || return
# Parse options
@@ -89,8 +89,8 @@ EOF
case $name in
# NAME must start with letters or an underscore, and contain no
- # characters besides letters, numbers, or underscores
- *[!a-zA-Z0-9_]*|[!a-zA-Z_]*)
+ # characters besides letters, numbers, underscores, or dashes
+ [!a-zA-Z_]*|*[!a-zA-Z0-9_-]*)
printf 'bash: %s: %s not a valid NAME\n' \
"${FUNCNAME[0]}" "$name" >&2
((errors++))
@@ -140,7 +140,7 @@ EOF
}
# Load any existing scripts in bashkeep
-for bashkeep in "${BASHKEEP:-"$HOME"/.bashkeep.d}"/*.bash ; do
+for bashkeep in "${XDG_DATA_HOME:-"$HOME"/.local/share}"/bashkeep/*.bash ; do
[[ -e $bashkeep ]] || continue
source "$bashkeep"
done