Fix creation of configdir in prehook #449
Merged
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.
Description
Related to: #432
While running
go test -v ./...
I noticed that the config dir~/.config/pat
was being created in my developmentenvironment. I would not expect running tests to result create extra dirs within $XDG_CONFIG_HOME. This was use to the
init()
function within prehooks.I opted to moved the prehooks dir setup into
main.go
which aligns with the rest of the config setup so running the testsuite no longer results in an additional dir being created in $XDG_CONFIG_HOME.
Tests
I dont have a good way to ensure that the prehook functionality still works a intended. I can confirm that the
script gets found and executed on my shack PC:
Create the prehook:
Attempt to connect to a gateway and call prehook:
Im assuming that the
Unexpected response
was becuase I just echoed a random string. It also seems thatany output is getting gobbled up by the existing connection since I dont see the "hello from prehook" text.
Go tests are all still passing: