Closed mattmc3 closed 1 year ago
Here's my thinking:
ZSHZ_DATA
or _Z_DATA
should include an explicit directory location.Instead of what you have in your second commit, we could do something like the following: right before we assign datafile
, we could have
# If the user has configured a custom datafile, make sure its directory is
# specified
if [[ -n ${ZSHZ_DATA:-${_Z_DATA}} && ${ZSHZ_DATA:-${_Z_DATA}} != */* ]]; then
print "Zsh-z: You have configured a custom datafile (${ZSHZ_DATA:-${_Z_DATA}}), but you have not specified its directory."
return
fi
Let me know what you think. And thanks for your patience.
I like it. I just pushed a new commit. I tweaked it just a tiny bit, so let me know if you were expecting something closer to your original ask or if this is acceptable.
One of the annoyances I've always had with rupa/z is that if you set
_Z_DATA
to an XDG compliant location (https://github.com/agkozak/zsh-z/issues/20), you have to make sure the directory exists with something like this:I tried zsh-z and it suffers from the same issue:
If a user sets the path they want to use for the z database, zsh-z should create it for them. Would you accept a PR that changes this line... https://github.com/agkozak/zsh-z/blob/82f5088641862d0e83561bb251fb60808791c76a/zsh-z.plugin.zsh#L164
...to this?