summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index e4e622e..4a04fbe 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -223,7 +223,9 @@ case "$command" in
if [[ $clip -eq 0 ]]; then
exec gpg2 -d $GPG_OPTS "$passfile"
else
- clip "$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)" "$path"
+ pass="$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)"
+ [[ -n $pass ]] || exit 1
+ clip "$pass" "$path"
fi
fi
;;