feat(run): allow run files in notes directories

Move `run` from a simple alias to a function which checks a for a
`.notes/run` file first or defaults back to the previous functionality
and uses a file in the current directory.
This commit is contained in:
Oliver Davies 2022-08-19 10:23:31 +01:00
parent 66b491395d
commit dc79ebf5a7
2 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,5 @@
alias hosts='sudo vim /etc/hosts'
alias rebase='git fetch --all --prune --prune-tags && git rebase'
alias run='./run'
alias sshconfig='vim ~/.ssh/config'
alias vim='nvim'

View file

@ -0,0 +1,8 @@
# Execute a "run" file either within ".notes" or the current directory.
function run {
if [[ -f .notes/run ]]; then
.notes/run "${@}"
elif [[ -f run ]]; then
./run "${@}"
fi
}