Enable null globs when scanning for config.d/*.sh#33
Open
nogweii wants to merge 1 commit intosilkeh:masterfrom
Open
Enable null globs when scanning for config.d/*.sh#33nogweii wants to merge 1 commit intosilkeh:masterfrom
nogweii wants to merge 1 commit intosilkeh:masterfrom
Conversation
Without this, an empty directory leads to an false error complaining that the file `/etc/dehydrated/config.d/*.sh` is not readable or doesn't exist. With `nullglob` set, the glob, if it doesn't match anything, will expand into null rather than returning the glob string, causing an empty config.d folder to not throw an error.
Owner
|
Thanks for this PR, seems sane to me generally. However, the unit tests fail because the script now exits with a zero exit code. $ env VERBOSE=yes ./test.sh tests/hooks.sh
Testing using Bash 5.1.16(1)-release
Hooks
+ exit [PASS]
+ deploy [PASS]
Hook errors
+ exit [PASS]
+ deploy [PASS]
Hook invalid scripts
+ exit [FAIL]
EXPECTED
./pdns_api.sh: line 369: /Foo3Xeiz: No such file or directory exit=127
GOT
./pdns_api.sh: line 373: /Foo3Xeiz: No such file or directory
exit=127
---
+ deploy [FAIL]
EXPECTED
./pdns_api.sh: line 375: /dah5Aiph: No such file or directory exit=127
GOT
./pdns_api.sh: line 379: /dah5Aiph: No such file or directory
exit=127
---
Tests complete: 2 failures. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this, an empty directory leads to an false error complaining that the file
/etc/dehydrated/config.d/*.shis not readable or doesn't exist.With
nullglobset, the glob, if it doesn't match anything, will expand into null rather than returning the glob string, causing an empty config.d folder to not throw an error.