mu/edit

22 lines
393 B
Bash
Executable File

#!/usr/bin/env zsh
# Helper to more conveniently open commonly-used SubX programs.
if [ $# -eq 0 ]
then
echo "Usage: $0 <file root without apps/ subdirectory or .subx extension>"
exit 1
fi
TARGET=apps/$1.mu
if [[ -e apps/$1.subx && ! -e apps/$1.mu ]]
then
TARGET=apps/$1.subx
fi
if [[ $EDITOR == *'vim'* ]]
then
$EDITOR -S vimrc.vim $TARGET
else
$EDITOR $TARGET
fi