]> us-delaporte.pagekite.me Git - minion.git/blob - bin/mp
Fixup for mdtohtml
[minion.git] / bin / mp
1 #!/usr/bin/bash
2 year=`date +%Y`
3 files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
4
5 if [ -z ${BROWSER} ]; then
6 echo "BROWSER unset, defaulting to Firefox"
7 export BROWSER=firefox
8 fi
9
10 counter=0
11 for file in $files; do
12 # echo $file
13 mdtohtml $file $file.html
14 $BROWSER $file.html
15 counter=$((counter + 1))
16 if [ $counter -gt 4 ]; then
17 echo "Aborting after 4 files."
18 echo "The following files would have been processed..."
19 echo $files
20 exit 1
21 fi
22 done