Clean-up; require_binary, comments, shellcheck

This commit is contained in:
3wc 2021-04-04 14:44:31 +02:00
parent c531faec52
commit 05cf00d272
1 changed files with 8 additions and 15 deletions

23
abra
View File

@ -385,7 +385,8 @@ debug() {
# 3wc: temporarily disable debug and verbose
silence() {
# FIXME 3wc: required otherwise we get debug output in the password
# temporaily disable debug & verbose output. useful for getting raw output
# from abra subcommands
_abra___debug="$abra___debug"
_abra___verbose="$abra___verbose"
abra___verbose="false"
@ -393,7 +394,7 @@ silence() {
}
unsilence() {
# FIXME 3wc: required otherwise we get debug output in the password
# restore original values of debug/verbose options
abra___verbose="$_abra___verbose"
abra___debug="$_abra___debug"
}
@ -419,14 +420,6 @@ require_binary() {
fi
}
require_pwqgen() {
require_binary pwqgen
}
require_wget() {
require_binary wget
}
require_abra_dir() {
mkdir -p "$ABRA_DIR"
}
@ -510,7 +503,7 @@ require_app_latest() {
require_yq() {
require_vendor_dir
require_wget
require_binary wget
YQ_VERSION="4.6.1"
YQ_BINARY="yq_linux_amd64"
@ -581,6 +574,8 @@ load_abra_sh() {
fi
}
###### FIXME 3wc: name this section
output_version_summary() {
echo " Versions:"
@ -719,8 +714,6 @@ ensure_domain_deployed() {
done
}
###### FIXME 3wc: name this section
get_servers() {
shopt -s nullglob dotglob
# shellcheck disable=SC2206
@ -1536,10 +1529,10 @@ sub_app_secret_generate(){
fi
if [[ -n "$LENGTH" ]]; then
require_pwgen
require_binary pwgen
PWGEN=${abra__cmd_:-pwgen -s "$LENGTH" 1}
else
require_pwqgen
require_binary pwqgen
PWGEN="${abra__cmd_:-pwqgen}"
fi