-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make build scripts compatible with Bash strict mode #329
Conversation
|
Reverting; sorry about that, habit from internal practices.
This isn't adding It may be cleaner to save/restore the |
In principle, avoid adding Variables requiring Line 67 in 0cfaaad
For variables defined within the function, we should set default values during their initialization with |
I've pushed up some additional changes that should address everything here. I think the minimum scenarios where
I've changed others like I also added |
First off, this is an awesome project and exactly what I was looking for; thanks!
I made a change to allow
argc
to work with scripts written for "Bash strict mode" (link), specificallyset -u
, which will cause a script to exit with an error when referencing an undefined variable.The only requirement for this is to change
$maybe_undefined
to${maybe_undefined:-}
, to provide a default value (empty string) when the variable is null/undefined.Bumped the version to
1.18.0
, allcargo test
tests are passing locally.Edit: it looks like there may be some more instances of this, I am tracking them down and converting this to a draft in the meantime. As an alternative approach, the
argc
generated functions could start by saving the state ofnounset
, disabling it withset +u
, and then restoring it at the end of the function. Let me know if you'd prefer this approach and I can change the implementation.