3 ms·
It's a very nice template, some great gems in there, like cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 . My general issue, and it applies here too I gue
by rich_sasha 6y ago
It's a very nice template, some great gems in there, like cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 .
My general issue, and it applies here too I guess, is that by the time I have 99 lines of Bash just as boilerplate,, +logic I might as well write it in Python. But if I just have to write Bash, I might use it one day.
- Normal_gaussian 6y agotbh the first three lines are more than enough if you dont need arg parsing or special handling for interrupts. CI and the like where they are (repeated) one shots. Notably the line you highlighted I do as SCRIPT_ROOT="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)" This preserves the cwd of the invoker (for relative files etc) wholst giving you access to your asset files etc.
- Brian_K_White 6y agoThat forked process to do something that's built-in for free is one of the worst parts about it, the opposite of a gem.