From 4c57cf4c778a3327df584245fee0e727aa021be9 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 2 Feb 2018 11:02:57 +0000 Subject: [qutebrowser] Handle empty input in user-password script --- .../.local/share/qutebrowser/userscripts/user-password | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'qutebrowser') diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/user-password b/qutebrowser/.local/share/qutebrowser/userscripts/user-password index c2db041..a571220 100755 --- a/qutebrowser/.local/share/qutebrowser/userscripts/user-password +++ b/qutebrowser/.local/share/qutebrowser/userscripts/user-password @@ -1,10 +1,10 @@ #!/usr/bin/env bash -target=$(find $HOME/.password-store/ -name "*.gpg" -printf "%P\n" | dmenu -i -p "Get identifier for:") -username=$(basename $target .gpg | sed 's/\\/\\\\/g; s/"/\\"/g') -password=$(pass show ${target%.gpg} | sed 's/\\/\\\\/g; s/"/\\"/g') -echo "fake-key ''" >> $QUTE_FIFO -echo "fake-key \"$username\"" >> $QUTE_FIFO -echo "fake-key ''" >> $QUTE_FIFO -echo "fake-key \"$password\"" >> $QUTE_FIFO -echo "fake-key \"$password\"" > ~/.test +target=$(find "$HOME"/.password-store/ -name "*.gpg" -printf "%P\\n" | dmenu -i -p "Get identifier for:") +[[ -z "$target" ]] && exit +username=$(basename "$target" .gpg | sed 's/\\/\\\\/g; s/"/\\"/g') +password=$(pass show "${target%.gpg}" | sed 's/\\/\\\\/g; s/"/\\"/g') +{ echo "fake-key ''"; + echo "fake-key \"$username\""; + echo "fake-key ''"; + echo "fake-key \"$password\""; } >> "$QUTE_FIFO" -- cgit v1.2.3