by flukus · 6y ago · 0 comments
#my vimrc knows what to do with this
export VIM_TAGFILES="$PWD/build/tags,$HOME/.local/var/tags/system,$HOME/.local/var/tags/glib-2.0"
export CFLAGS=' -g -O0 '
function autobuild {
(mkdir -p build
cd build
while true; do
make
make deploy
inotifywait -qr -e close_write,delete ../cgi ../test ../Makefile.am ../migrate.sql;
done)
}
function watch {
tail -f build/app.log build/deploy/app.log
}
Over time they'll end up with a bunch of other random things. I've tried abstracting a lot of these to their own scripts but every project proves just different enough to make that more complicated. And most of them are personalized enough that they don't go into the project itself.Another "super power" for shell scripts is writing completion scripts (https://iridakos.com/programming/2018/03/01/bash-programmabl...). I've had some insanely useful one's do things like look up database values to mimic a large complicated third party product, going through it's UI inputting repetitive info, copying files around, etc was reduced to fake-tool<tab><tab><tab><tab>.
I like to put scripts for the project in a `bin/` directory then use direnv to put the project's `bin/` on PATH.
I've leaned more and more towards mirroring the *nix directory structure in my projects. `etc/` and `bin/` are two top-level folders in a lot of my projects at work.