In Makefile‘s I can define tasks so that a user can specify what s/he wants to do as:
make run
make serve
make deploy
..
This seems to be working ok but I feel like Makefile‘s are an overkill for this purpose with all those dependency analysis and relatively obscure syntax/execution. Are there any language/tool that is specifically designed for this purpose preferably available on most systems? or any idea how to use something like bash for this purpose?
So after Arjun’s suggestion, I have come up with a
shscript:which was a lot easier than I imagined. I have named the file
taskso that I can now run the tasks as:or if the file is executable:
There’s just a little bit duplication in
switchstatement but it’s good enough for me. Feel free to drop me a comment if it can get any better.