Need to egg my face, I introduced a bug in https://github.com/ariovistus/pyd/pull/148/ - forgot to pass arguments down from the script to the main function. I made untested edits in that PR ("what's the worst that could happen?"); this time I tested this carefully.
Took the opportunity to make a few improvements that make the script more robust:
the shebang line avoids inadvertently running the script in a separate shell, otherwise it would appear to run successfully but have no effect
main has a random suffix so as to avoid clashing with some other main in the current environment
replaced the test -z $1 with $# -eq 0 because if the calling environment has set -u, it would fail on account of unset variable
quoted strings as https://www.shellcheck.net indicated, on the off chance somebody has spaces in dir names
Need to egg my face, I introduced a bug in https://github.com/ariovistus/pyd/pull/148/ - forgot to pass arguments down from the script to the main function. I made untested edits in that PR ("what's the worst that could happen?"); this time I tested this carefully.
Took the opportunity to make a few improvements that make the script more robust:
main
has a random suffix so as to avoid clashing with some othermain
in the current environment-z $1
with$# -eq 0
because if the calling environment hasset -u
, it would fail on account of unset variableApologies for the mess!