X-Git-Url: https://us-delaporte.pagekite.me/gitweb/minion.git/blobdiff_plain/3cb071d4349ce044d5e2d2a9207b25f1c419ab37..a547243528179f0659cc1cd7d97e9d50e4a76b0c:/bin/moa diff --git a/bin/moa b/bin/moa index f11065e..f66c00e 100755 --- a/bin/moa +++ b/bin/moa @@ -1,2 +1,13 @@ -#!/usr/bin/fish -vim $(find $HOME/Journal -type f -iname "*$argv*\.md") +#!/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 [ -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 $more_files