X-Git-Url: https://us-delaporte.pagekite.me/gitweb/minion.git/blobdiff_plain/71ccf7cbe021ab4cbd096d99f1ddac35fe88b005..1853b9b4021c1b24683e6fbc60dd1c4ef502bf30:/bin/mo?ds=sidebyside diff --git a/bin/mo b/bin/mo index 7f4d046..7d0e7cd 100755 --- a/bin/mo +++ b/bin/mo @@ -1,7 +1,14 @@ -#!/usr/bin/bash +#!/bin/bash +# mo - minion open +# Like `ml / minion list`, but opens all matches in your $EDITOR +# Optionally search a second term - to quickly open differently named files year=`date +%Y` files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") -if [ !x"${EDITOR}" ]; then +if [ -n "$2" ]; then + more_files=$(find $HOME/Journal/$year -type f -iname "*$2*\.md") +fi +if [ -z ${EDITOR} ]; then + echo "EDITOR unset, defaulting to Nano" export EDITOR=nano fi -$EDITOR $files +$EDITOR $files $more_files