From 36498079d4913659c0226a56e0ce781489fe1b69 Mon Sep 17 00:00:00 2001 From: Roland Puntaier Date: Thu, 29 Aug 2019 10:40:19 +0200 Subject: [PATCH] debug last change --- bin/mw | 18 ++++++++++-------- test/dotests | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/mw b/bin/mw index 5184fbe..62c70ae 100755 --- a/bin/mw +++ b/bin/mw @@ -154,9 +154,9 @@ askinfo() { printf "\033[0m" done fi - domain="$(echo "$mwaddr" | sed "s/.*@//")" - printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$domain" - mwserverinfo="$(grep "^$domain" "$mwshare/domains.csv" 2>/dev/null)" + mwdomain="$(echo "$mwaddr" | sed "s/.*@//")" + printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$mwdomain" + mwserverinfo="$(grep "^$mwdomain" "$mwshare/domains.csv" 2>/dev/null)" if [ -z "$mwserverinfo" ]; then printf "Your email domain is not known to mutt-wizard.\\nType in your settings.\\nUsually you find them by an internet search.\\n" printf "Type the IMAP server (excluding the port number)\\n\033[36m\t" @@ -167,12 +167,12 @@ askinfo() { read -r mwsmtp printf "\033[0mSMTP port number (usually 587 or 465)\\n\033[36m\t" read -r mwsport - printf "\033[0m\\nIf you want, you can copy the line below and add it to the \`domains.csv\` file on Github, for others.\\n\\n%s,%s,%s,%s,%s\\n\\nBut be sure the setting works, first! ;-)\\n" "$domain" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport" + printf "\033[0m\\nIf you want, you can copy the line below and add it to the \`domains.csv\` file on Github, for others.\\n\\n%s,%s,%s,%s,%s\\n\\nBut be sure the setting works, first! ;-)\\n" "$mwdomain" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport" else IFS=, read -r mwservice mwimap mwiport mwsmtp mwsport <> "$mwaccrc" - echo "macro index,pager i$idnum $muttsync \"switch to $mwaddr\" # mw-autogenerated" >> "$mwaccrc" - [ "$mwtype" = "offline" ] && printf "All done.\\n\033[33mYou can now run \`\033[32mmailsync [%s]\033[33m\` to sync your mail.\033[0m\\n" "$mwaccount" + echo "macro index,pager i$idnum '$muttsync' \"switch to $mwaddr\" # mw-autogenerated" >> "$mwaccrc" + if [ "$mwtype" = "offline" ]; then + echo "folder-hook \$folder '$muttsync' # mw-autogenerated" >> "$mwaccrc" + printf "All done.\\n\033[33mYou can now run \`\033[32mmailsync [%s]\033[33m\` to sync your mail.\033[0m\\n" "$mwaccount" + fi command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" return 0 } diff --git a/test/dotests b/test/dotests index 28b46c9..a803aa5 100755 --- a/test/dotests +++ b/test/dotests @@ -23,7 +23,7 @@ rm -rf $mwmaildir/$mwaddr export mwmaildir=$MAILDIR export mwname='r n' export mwlogin=$mwaddr -export mwpass="${mwpass:-mutt-wizard-$mwaddr} +export mwpass="${mwpass:-mutt-wizard-$mwaddr}" [ -f ~/.password-store/$mwpass.gpg ] || pass insert $mwpass echo "= manual test 1 ="