Bläddra i källkod

Added comments to addfolder

pull/349/head
Mr Chainman 6 år sedan
förälder
incheckning
d6d76f3a58
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 3A782BCA8E54519F
1 ändrade filer med 9 tillägg och 0 borttagningar
  1. +9
    -0
      bin/addfolder

+ 9
- 0
bin/addfolder Visa fil

@@ -1,20 +1,29 @@
#!/bin/sh #!/bin/sh
echo "Specify account:" echo "Specify account:"
# The account to put the folder in
read -r acc read -r acc
# get the full path
acc_spec=$(ls ~/.config/mutt/accounts/ | grep "$acc") acc_spec=$(ls ~/.config/mutt/accounts/ | grep "$acc")
echo "Specify folder:" echo "Specify folder:"
# Ask for the foldername
read -r folder read -r folder
# Echo back foldername (for informational purpose)
echo "$folder" echo "$folder"
# Create needed directories
mkdir -p ~/.local/share/mail/"$acc"/"$folder"/new mkdir -p ~/.local/share/mail/"$acc"/"$folder"/new
mkdir -p ~/.local/share/mail/"$acc"/"$folder"/tmp mkdir -p ~/.local/share/mail/"$acc"/"$folder"/tmp
mkdir -p ~/.local/share/mail/"$acc"/"$folder"/cur mkdir -p ~/.local/share/mail/"$acc"/"$folder"/cur
# Add the folder to muttrc
sed -i "/^mailboxes/ s/$/ \"="$folder"\"/" ~/.config/mutt/accounts/"$acc_spec" sed -i "/^mailboxes/ s/$/ \"="$folder"\"/" ~/.config/mutt/accounts/"$acc_spec"
# Ask if a shortcut is needed
echo "Folder created, do you want to add a shortcut?" echo "Folder created, do you want to add a shortcut?"
read -r shortcut read -r shortcut
# If yes, then ask for the shortcutkey (without prefix)
if [ "$shortcut" = "y" ] if [ "$shortcut" = "y" ]
then then
echo "Specify Shortcut:" echo "Specify Shortcut:"
read -r key read -r key
# Add shortcuts to muttrc
cat <<EOF >> ~/.config/mutt/accounts/"$acc_spec" cat <<EOF >> ~/.config/mutt/accounts/"$acc_spec"
# #
macro index,pager g$key "<change-folder>=$folder<enter>" "go to $folder" macro index,pager g$key "<change-folder>=$folder<enter>" "go to $folder"


Laddar…
Avbryt
Spara