summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/mw b/bin/mw
index 7eefed9..b693299 100755
--- a/bin/mw
+++ b/bin/mw
@@ -7,11 +7,11 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
}
! command -v mbsync >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit
-if [ "$OSTYPE" = "darwin" ]; then
- prefix="/usr/local"
-else
- prefix="/usr"
-fi
+case "$(uname)" in
+ Linux) prefix="/usr" ;;
+ *) prefix="/usr/local" ;;
+esac
+
muttdir="$HOME/.config/mutt" # Main mutt config location
accdir="$muttdir/accounts" # Directory for account settings
maildir="$HOME/.local/share/mail" # Location of mail storage
@@ -216,7 +216,7 @@ tryconnect() { mkdir -p "$maildir/$title"
fi ;}
finalize() { \
- boxes="$(find "$maildir/$title/" -mindepth 1 -maxdepth 1 | sed "s/^.*\//=/")"
+ boxes="$(find "$maildir/$title/" -mindepth 1 -maxdepth 1 | sed "s/\ /\\\ /g;s/^.*\//=/")"
[ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that mbsync has not been successfully run.\\nRun mbsync, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return
printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n"
spoolfile=$(echo "$boxes" | grep -i -m 1 inbox | sed 's/=/+/g')