(no title)
Nexialist | 3 years ago
Being able to drop into any repo at work and expect that `make init`, `make test` and `make start` will by convention always work no matter what the underlying language or technology is, has saved me a lot of time.
Nexialist | 3 years ago
Being able to drop into any repo at work and expect that `make init`, `make test` and `make start` will by convention always work no matter what the underlying language or technology is, has saved me a lot of time.
shoo|3 years ago
For many junior colleagues, this pattern is the first time they've ever encountered make -- hijacked as some kind of imperative command runner.
It's quite rare to run into someone who is aware that make can be used to define rules for producing files from other files.
I find it all a bit odd. Of course, no-one is born knowing about middle-aged build tools.
arinlen|3 years ago
Is it, though?
That's literally what Make does as part of its happy path.
GNU Make even added support for pattern rules, as this use case is so pervasive.
What do you think people think make is about?
3836293648|3 years ago
sanderjd|3 years ago
pornel|3 years ago
txutxu|3 years ago
The advantage could be, maybe, no need to install make if not present, and no need to learn make stuff if you don't know it.
Sometimes they don't match the usual words (deploy, start, stop, etc) but then I know that if I don't remember them, I just type ./runme and get the help.
For my scenario, it's perfect because of it's simplicity.
dymk|3 years ago
whateveracct|3 years ago
kazinator|3 years ago
The above won't.
ReadTheLicense|3 years ago
patrickthebold|3 years ago
nickjj|3 years ago
The benefit of this is it's just shell scripting so you can use shell features like $@ to pass args to another command and everything else the shell has to offer.
I've written about this process at https://nickjanetakis.com/blog/replacing-make-with-a-shell-s... and an example file is here https://github.com/nickjj/docker-flask-example/blob/main/run.
js2|3 years ago
If I had to pick one nit, and it’s a stylistic choice, you use braces around variable names where they aren’t strictly needed.
I also like to add “set -u”.
pak9rabid|3 years ago
That command (to run an Angular/nodejs dev instance has staved off carpel-tunnel syndrome for me for maybe another 5 years.