spm

simple password manager
git clone anongit@rnpnr.xyz:spm.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 5f384cde7d0968fee58e1ed23febcd86b6dc4dc9
Parent: 7fb7e5e9ddba4fcae1043ccfd803746fc70287e9
Author: Klemens Nanni
Date:   Fri,  3 Jun 2016 01:40:03 +0200

Remove unneccessary check in 'show' function

Diffstat:
Mspm.sh | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

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}" }