spm

Personal fork of spm (simple password manager)

commit bc26db5d48fa56674ef00574ae0b6459ace36a78
parent 17cc56061e392f7a3760fd791e4c8fe0bc162c31
Author: Klemens Nanni <kl3@posteo.org>
Date: Thu, 15 Sep 2016 01:09:50 +0200

Test line count before checking files in check()
1 file changed, 3 insertions(+), 3 deletions(-)
M
spm.sh
|
6
+++---
diff --git a/spm.sh b/spm.sh
@@ -35,10 +35,10 @@ usage() {
 }
 
 check() {
-	[ -z "${entry}" ] && usage 'No such entry'
-
-	[ "$(printf '%s' "${entry}" | wc -l)" -gt 0 ] \
+	[ $(printf '%s' "${entry}" | wc -l) -gt 0 ] \
 		&& usage "Ambigious keyword. Try 'spm search'"
+
+	[ -z "${entry}" ] && usage 'No such entry'
 }
 
 gpg() {