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

13
abra
View File

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