summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-12 17:29:42 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-06-24 00:01:22 +0200
commit3d7e7b011996345b1c57e8759e47a0a47f4a41ac (patch)
tree5e5c5e0eb5f9bc757cc4a6c56492e565b8432fd3 /src/password-store.sh
parent4ff04feaa454b05efb6fe4e2ac1c436ee2bdfa6d (diff)
downloadpass-necoro.tar.gz
pass-necoro.tar.bz2
pass-necoro.zip
Fix order of conditionsnecoro
Diffstat (limited to 'src/password-store.sh')
-rwxr-xr-xsrc/password-store.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 76620cd..35e7a51 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -387,10 +387,7 @@ cmd_show() {
local passfile="$PREFIX/$path.gpg"
check_sneaky_paths "$path"
if [[ -f $passfile ]]; then
- if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then
- pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $?
- echo "$pass" | $BASE64 -d
- elif [[ $user -eq 1 ]]; then
+ if [[ $user -eq 1 ]]; then
local user="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep -m 1 "^${USER_STRING}" | sed -e "s/^${USER_STRING}"'\(.*\)/\1/')"
[[ -n $user ]] || exit 1
@@ -402,6 +399,9 @@ cmd_show() {
else
echo "$user"
fi
+ elif [[ $clip -eq 0 && $qrcode -eq 0 ]]; then
+ pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $?
+ echo "$pass" | $BASE64 -d
else
[[ $selected_line =~ ^[0-9]+$ ]] || die "Clip location '$selected_line' is not a number."
pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n +${selected_line} | head -n 1)" || exit $?
14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0