]> apps.delaporte.us Git - minion.git/commitdiff
Update to use bash shell
authorEdward Delaporte <edward@delaporte.us>
Wed, 3 Jun 2026 22:19:05 +0000 (17:19 -0500)
committerEdward Delaporte <edward@delaporte.us>
Wed, 3 Jun 2026 22:19:05 +0000 (17:19 -0500)
bin/mh
bin/ml
bin/mla
bin/mn
bin/mo
bin/moa
bin/ms

diff --git a/bin/mh b/bin/mh
index df48f4c05b5a1482d6c796cca36a1667ba52e8ec..18f19c4a3815db244d3c343d0a39b78db071c8fd 100755 (executable)
--- a/bin/mh
+++ b/bin/mh
@@ -1,19 +1,24 @@
-#!/usr/bin/fish
+#!/usr/bin/bash
 echo "Usage:"
 echo ""
 echo "mn - minion new - edit a new file with the year and month in the name"
 echo "mh - minion help - print this help"
 echo "ml - minion list - list all files that match"
 echo "Usage:"
 echo ""
 echo "mn - minion new - edit a new file with the year and month in the name"
 echo "mh - minion help - print this help"
 echo "ml - minion list - list all files that match"
-echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)"
 echo "mo - minion open - open all files that match"
 echo "mo - minion open - open all files that match"
-echo "ms - minion spell - open the matching file with `aspell`"
 echo ""
 echo "Examples:"
 echo ""
 echo ""
 echo "Examples:"
 echo ""
-echo "mn meeting topic - open a file Journal/2026/04-meeting-topic.md"
+echo "mn meeting topic - open a (new) file Journal/2026/04-meeting-topic.md"
 echo "ml 04 - list files created in April"
 echo "mo manager - open files named with 'manager' to edit"
 echo ""
 echo "ml 04 - list files created in April"
 echo "mo manager - open files named with 'manager' to edit"
 echo ""
-echo "mla, moa - minion X all - act as `ml` and `mo`, but include all previous years of Journal entries"
+echo "Advanced Usage:"
+echo ""
+echo "mp - minion print - convert matching files to HTML and open in Firefox (requires https://github.com/gomarkdown/markdown)"
+echo "ms - minion spell - open the matching file with 'aspell'"
+echo "mla, moa - minion X all - act as 'ml' and 'mo', but include all previous years of Journal entries"
+echo ""
+echo "On vi integration:"
+echo ""
 echo "In vi - :r!ml <term> will add list of files to the current buffer"
 echo "In vi - gf - opens the file name under the cursor - as long as it has no spaces"
 echo "In vi - :r!ml <term> will add list of files to the current buffer"
 echo "In vi - gf - opens the file name under the cursor - as long as it has no spaces"
diff --git a/bin/ml b/bin/ml
index 4acb2111108f54db0b5484d4d7bf0cb937e9e6ea..b622021e1bdecfb0f0012158a1b35d3198afa204 100755 (executable)
--- a/bin/ml
+++ b/bin/ml
@@ -1,3 +1,3 @@
-#!/usr/bin/fish
-set year (date +%Y)
-find $HOME/Journal/$year -type f -iname "*$argv*\.md"
+#!/usr/bin/bash
+year=`date +%Y`
+find $HOME/Journal/$year -type f -iname "*$1*\.md"
diff --git a/bin/mla b/bin/mla
index 38103ea2d712a21b4accffa16929cf966eec4ffc..95f115d64c90ed0d06698183ac2c8ee1bf040f39 100755 (executable)
--- a/bin/mla
+++ b/bin/mla
@@ -1,2 +1,2 @@
-#!/usr/bin/fish
-find $HOME/Journal -type f -iname "*$argv*\.md"
+#!/usr/bin/bash
+find $HOME/Journal -type f -iname "*$1*\.md"
diff --git a/bin/mn b/bin/mn
index 92f3eb8b6e91b7481d6745f0920d2c6b82677747..f3b823aea2ef9dfb4d57fb5192cb1a0038176820 100755 (executable)
--- a/bin/mn
+++ b/bin/mn
@@ -1,6 +1,10 @@
-#!/usr/bin/fish
-set year (date +%Y)
-set input $(string join '-' $argv)
-set topic $(string replace -a ' ' '-' $input)
+#!/usr/bin/bash
+year=`date +%Y`
+input=$@
+topic=${input// /-}
 mkdir -p "$HOME/Journal/$year"
 mkdir -p "$HOME/Journal/$year"
-vim $(printf "$HOME/Journal/$year/%02d-$topic.md" (date +%m))
+if [ !x"${EDITOR}" ]; then
+       export EDITOR=nano
+fi
+fname=$(printf "$HOME/Journal/$year/%02d-$topic.md" $(date +%m))
+$EDITOR $fname
diff --git a/bin/mo b/bin/mo
index 2ebc8db48afd8ad5cd39025fa780b3af6bdd0ff8..7f4d04602418f87e44feacca25bfc6e6c53b409f 100755 (executable)
--- a/bin/mo
+++ b/bin/mo
@@ -1,3 +1,7 @@
-#!/usr/bin/fish
-set year (date +%Y)
-vim $(find $HOME/Journal/$year -type f -iname "*$argv*\.md")
+#!/usr/bin/bash
+year=`date +%Y`
+files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
+if [ !x"${EDITOR}" ]; then
+       export EDITOR=nano
+fi
+$EDITOR $files
diff --git a/bin/moa b/bin/moa
index f11065e519b59354121aa20b48a1e09f5f6bb7dd..ea4ea99f46be531e0a9d923ef5feb3948a3941c3 100755 (executable)
--- a/bin/moa
+++ b/bin/moa
@@ -1,2 +1,6 @@
-#!/usr/bin/fish
-vim $(find $HOME/Journal -type f -iname "*$argv*\.md")
+#!/usr/bin/bash
+files=$(find $HOME/Journal -type f -iname "*$1*\.md")
+if [ !x"${EDITOR}" ]; then
+       export EDITOR=nano
+fi
+$EDITOR $files
diff --git a/bin/ms b/bin/ms
index 76e9dfdc59c4ecfd31961a7eb16fe7bae00e093f..e969043fd22828affe63caa2399bdcc35f445874 100755 (executable)
--- a/bin/ms
+++ b/bin/ms
@@ -1,2 +1,3 @@
-#!/usr/bin/fish
-aspell check "$(ml $argv)"
+#!/usr/bin/bash
+files=$(ml $1)
+aspell check $files