spm

Personal fork of spm (simple password manager)

commit 5f384cde7d0968fee58e1ed23febcd86b6dc4dc9
parent 7fb7e5e9ddba4fcae1043ccfd803746fc70287e9
Author: Klemens Nanni <kl3@posteo.org>
Date: Fri, 3 Jun 2016 01:40:03 +0200

Remove unneccessary check in 'show' function
1 file changed, 5 insertions(+), 9 deletions(-)
M
spm.sh
|
14
+++++---------
diff --git a/spm.sh b/spm.sh
@@ -85,17 +85,13 @@ del() {
 show() {
 	[ -z "${1}" ] && die 'Name must not be empty.'
 
-	entry="${STORE_DIR}"/"${1}".gpg
+	entry=$(find "${STORE_DIR}" \( -type f -o -type l \) \
+			-iwholename "*${1}*".gpg)
 
-	if [ ! -r "${entry}" ]; then
-		entry=$(find "${STORE_DIR}" \( -type f -o -type l \) \
-				-iwholename "*${1}*".gpg)
+	[ -z "${entry}" ] && die 'No such entry.'
 
-		[ -z "${entry}" ] && die 'No such entry.'
-
-		[ "$(printf '%s' "${entry}" | wc -l)" -gt 0 ] \
-			&& die 'Too ambigious keyword.'
-	fi
+	[ "$(printf '%s' "${entry}" | wc -l)" -gt 0 ] \
+		&& die 'Too ambigious keyword.'
 
 	gpg --decrypt "${entry}"
 }