mirror of
https://github.com/jarun/nnn.git
synced 2025-01-28 19:56:48 +00:00
use "xarg -0" instead of trim
This commit is contained in:
parent
1e1abdfb31
commit
3c43564182
19
plugins/gpgs
19
plugins/gpgs
|
@ -12,6 +12,7 @@
|
||||||
# Shell: POSIX compliant
|
# Shell: POSIX compliant
|
||||||
# Author: wassup05
|
# Author: wassup05
|
||||||
|
|
||||||
|
file=$1
|
||||||
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
|
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
|
||||||
|
|
||||||
printf "(s)election/(c)urrent? [default=c] "
|
printf "(s)election/(c)urrent? [default=c] "
|
||||||
|
@ -19,18 +20,20 @@ read -r file_resp
|
||||||
printf "(s)ign/(c)learsign/(d)etach-sig? [default=s] "
|
printf "(s)ign/(c)learsign/(d)etach-sig? [default=s] "
|
||||||
read -r sig_resp
|
read -r sig_resp
|
||||||
|
|
||||||
if [ "$file_resp" = "s" ]; then
|
getfiles(){
|
||||||
files=$(tr '\0' '\n' < "$selection")
|
if [ "$file_resp" = "s" ]; then
|
||||||
else
|
cat "$selection"
|
||||||
files=$1
|
else
|
||||||
fi
|
printf "%s\0" "$file"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$sig_resp" = "c" ]; then
|
if [ "$sig_resp" = "c" ]; then
|
||||||
printf "%s" "$files" | xargs -I{} gpg --clearsign {}
|
getfiles | xargs -0 -I{} gpg --clearsign {}
|
||||||
elif [ "$sig_resp" = "d" ]; then
|
elif [ "$sig_resp" = "d" ]; then
|
||||||
printf "%s" "$files" | xargs -I{} gpg --detach-sig --output "{}.sig"
|
getfiles | xargs -0 -I{} gpg --detach-sig --output "{}.sig"
|
||||||
else
|
else
|
||||||
printf "%s" "$files" | xargs -I{} gpg --sign --output "{}.sig" {}
|
getfiles | xargs -0 -I{} gpg --sign --output "{}.sig" {}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clear selection
|
# Clear selection
|
||||||
|
|
Loading…
Reference in a new issue