]> us-delaporte.pagekite.me Git - minion.git/blob - bin/mo
Sort minion list output
[minion.git] / bin / mo
1 #!/bin/bash
2 # mo - minion open
3 # Like `ml / minion list`, but opens all matches in your $EDITOR
4 # Optionally search a second term - to quickly open differently named files
5 year=`date +%Y`
6 files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
7 if [ -n "$2" ]; then
8 more_files=$(find $HOME/Journal/$year -type f -iname "*$2*\.md")
9 fi
10 if [ -z ${EDITOR} ]; then
11 echo "EDITOR unset, defaulting to Nano"
12 export EDITOR=nano
13 fi
14 $EDITOR $files $more_files