X-Git-Url: https://apps.delaporte.us/gitweb/minion.git/blobdiff_plain/71ccf7cbe021ab4cbd096d99f1ddac35fe88b005..6b4a3cd4428e0643d5399c8760b9d2fb774f9c1c:/bin/moa?ds=sidebyside diff --git a/bin/moa b/bin/moa index ea4ea99..f66c00e 100755 --- a/bin/moa +++ b/bin/moa @@ -1,6 +1,13 @@ -#!/usr/bin/bash +#!/bin/bash +# moa - minion open any +# Like `mla / minion list any`, but opens all matches in your $EDITOR +# Optionally search a second term - to quickly open differently named files files=$(find $HOME/Journal -type f -iname "*$1*\.md") -if [ !x"${EDITOR}" ]; then +if [ -n "$2" ]; then + more_files=$(find $HOME/Journal -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