1
0
Fork 0

xdgtag: Delete attribute if empty

This commit is contained in:
tastytea 2022-04-10 18:55:47 +02:00
parent 210ea9aca3
commit a8688a8978
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,11 @@ case ${cmd} in
for tag in ${(@)tags}; do
taglist=(${(@)taglist:#${tag}})
done
zsetattr ${file} ${attribute} "${(j/,/)taglist}"
if [[ -n ${taglist} ]]; then
zsetattr ${file} ${attribute} ${(j/,/)taglist}
else
zdelattr ${file} ${attribute}
fi
;;
find)
setopt LOCAL_OPTIONS GLOB