about summary refs log tree commit diff stats
path: root/subx/g
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-07 10:57:56 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-07 10:57:56 -0700
commitebe2bda37b74bc73550a051895b1831f8c2441ca (patch)
tree00e214e4ef8b2167e00f8d7066225ce03ed87117 /subx/g
parent37b3206e49572cf245ef7ee13d5bd24845f6a2e8 (diff)
downloadmu-ebe2bda37b74bc73550a051895b1831f8c2441ca.tar.gz
4321
Modify helpers to run either external examples in the subx/teensy/
directory, or my own examples in subx/ directory.

Now I have to say `run test5` instead of `run 5`, and so on.
Diffstat (limited to 'subx/g')
-rwxr-xr-xsubx/g11
1 files changed, 8 insertions, 3 deletions
diff --git a/subx/g b/subx/g
index dc57cceb..25da2232 100755
--- a/subx/g
+++ b/subx/g
@@ -3,12 +3,17 @@
 
 if [ $# -eq 0 ]
 then
-  echo "g <git command> <args> <suffix>"
+  echo "g <git command> <args> <target>"
   exit 1
 fi
 
 arg=( $* )
-suffix=$arg[${#arg[@]}]
+target=$arg[${#arg[@]}]
 unset "arg[${#arg[@]}]"
 
-git ${arg[@]} ./teensy/test$suffix*.[cs]
+if [[ $target == 'test'* ]]
+then
+  git ${arg[@]} ./teensy/$target*.[cs]
+else
+  git ${arg[@]} ./$target*.subx
+fi