Only check for pw(q)gen if we're tryna use them

Ref #147
This commit is contained in:
3wc 2021-04-17 12:29:39 +02:00
parent 5649730446
commit 208b11af0a
1 changed files with 9 additions and 4 deletions

13
abra
View File

@ -1632,12 +1632,17 @@ sub_app_secret_generate(){
fi
if [[ -n "$LENGTH" ]]; then
require_binary pwgen
PWGEN=${abra__cmd_:-pwgen -s "$LENGTH" 1}
if [ -z "$abra__cmd_" ]; then
require_binary pwgen
abra__cmd_="pwgen -s \"$LENGTH\" 1"
fi
else
require_binary pwqgen
PWGEN="${abra__cmd_:-pwqgen}"
if [ -z "$abra__cmd_" ]; then
require_binary pwqgen
abra__cmd_=pwqgen
fi
fi
PWGEN=${abra__cmd_}
debug "SECRET: $SECRET, VERSION $VERSION, PW $PWGEN, ALL $abra___all"