boxes flat; delete failures

This commit is contained in:
Luke Smith 2019-04-21 13:33:09 -04:00
parent cb404dfe7c
commit 1c01187578
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252

6
mw
View File

@ -38,6 +38,7 @@ MaildirStore $title-local
Subfolders Verbatim Subfolders Verbatim
Path ~/.local/share/mail/$title/ Path ~/.local/share/mail/$title/
Inbox ~/.local/share/mail/$title/INBOX Inbox ~/.local/share/mail/$title/INBOX
Flatten .
Channel $title Channel $title
Expunge Both Expunge Both
@ -180,12 +181,13 @@ formatShortcut() { \
trysync() { ! ping -q -c 1 1.1.1.1 > /dev/null && printf "No internet connection detected.\\nTry rerunning \`mbsync %s\` manually when connection is established, then select the option to detect mailboxes and finalize installation.\\n" "$title" && return 1 trysync() { ! ping -q -c 1 1.1.1.1 > /dev/null && printf "No internet connection detected.\\nTry rerunning \`mbsync %s\` manually when connection is established, then select the option to detect mailboxes and finalize installation.\\n" "$title" && return 1
mkdir -p "$maildir/$title" mkdir -p "$maildir/$title"
if mailboxes="$(mbsync -l "$title")" >/dev/null 2>&1; then if mailboxes="$(mbsync -l "$title" | sed 's/\//./')" >/dev/null 2>&1; then
[ "$accounttype" = "online" ] && sed -i "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc" [ "$accounttype" = "online" ] && sed -i "/IMAPStore $title-remote$/,/# End profile/d" "$mbsyncrc"
printf "\033[32mMailboxes detected.\033[0m\\n" printf "\033[32mMailboxes detected.\033[0m\\n"
echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}" echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$title/{}"
else else
printf "\033[31m\033[31mSync not successful.\033[0m Try running \`mbsync %s\` manually after double-checking your password and server settings.\\nThen select to finalize the account.\\n" "$title"; return 1 printf "\033[31m\033[31mLog-on not successful.\033[0m\\nIt seems that either you inputted the wrong password or sever settings, or there are other requirements for your account out of the control of mutt-wizard.\\n"
delete "$title"; return 1
fi fi
} }