3 ms·
tbh 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 sh
by Normal_gaussian 6y ago
tbh 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.