aboutsummaryrefslogtreecommitdiff
path: root/zsh/zshrc.d/keep.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/zshrc.d/keep.zsh')
-rw-r--r--zsh/zshrc.d/keep.zsh8
1 files changed, 4 insertions, 4 deletions
diff --git a/zsh/zshrc.d/keep.zsh b/zsh/zshrc.d/keep.zsh
index 869d2039..36d2f57d 100644
--- a/zsh/zshrc.d/keep.zsh
+++ b/zsh/zshrc.d/keep.zsh
@@ -29,7 +29,7 @@ keep() {
# Figure out the directory to which we're reading and writing these scripts
local zshkeep
- zshkeep=${ZSHKEEP:-"$HOME"/.zshkeep.d}
+ zshkeep=${XDG_DATA_HOME:-"$HOME"/.local/share}/zshkeep
mkdir -p -- "$zshkeep" || 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 'zsh: %s: %s not a valid NAME\n' \
"${FUNCNAME[0]}" "$name" >&2
((errors++))
@@ -141,7 +141,7 @@ EOF
}
# Load any existing scripts in zshkeep
-for zshkeep in "${ZSHKEEP:-"$HOME"/.zshkeep.d}"/*.zsh(N) ; do
+for zshkeep in "${XDG_DATA_HOME:-"$HOME"/.local/share}"/zshkeep/*.zsh(N) ; do
[[ -e $zshkeep ]] || continue
source "$zshkeep"
done