mu-wizard

shell script to easily configure mu4e accounts on Emacs
git clone git://git.ckyln.com/mu-wizard
Log | Files | Refs | LICENSE

commit 481a80f2a6a3e024dc1ece1e22f8c39b7a16031d
parent 405035faccdd9fda1fd0e85e0f48b141c22843cc
Author: Cem Keylan <cem@ckyln.com>
Date:   Wed, 25 May 2022 17:05:27 +0200

main(): separate preparation to its own function

Diffstat:
Mbin/muw | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/muw b/bin/muw @@ -679,15 +679,19 @@ get_information() { case "$sport" in 465) starttlsoff="tls_starttls off"; esac } -main() { +prepare() { + # Make the initial checks to make sure we have the necessary programs to + # actually run mu-wizard. pass_prog=${MUW_PWM:-$(command -v pass || command -v pash || command -v pm)} || die "No applicable password manager found." command -v mbsync >/dev/null || die "mbsync must be installed for mu-wizard to work." + # Set some variables that are used throughout the script. sharedir=/usr/share/mu-wizard ssltype=IMAPS msg_behavior=sent + # Create configuration and cache directories. mkdir -p "${config_home:=${XDG_CONFIG_HOME:-$HOME/.config}}" \ "${confdir:=$config_home/mu4e}" \ "${cac_dir:=${XDG_CACHE_HOME:-$HOME/.cache}}" \ @@ -715,6 +719,10 @@ main() { command -v herbe)} || notify_method=null } + +main() { + prepare + eval "$(getoptions parser_definition parse)" parse "$@"; eval set -- "$REST" action=$1; shift