Draft
Conversation
Fixes #303 Signed-off-by: Richard Hartmann <richih@richih.org>
55158a1 to
4f27e5a
Compare
Owner
Author
|
I am unsure if Line 704 in 4f013c3 ${VCSH_REPO_NAME-} or if that's overly brittle given what we're trying to achieve with strict mode. We might want to add a variable which explicitly tells us if VCSH_REPO_NAME should be set instead of transporting this information implicitly by the variable itself being set, or not. I am not certain if that's more resilient in the end, though.
|
`set -o nounset` made it clear that my flow control is really really bad and relies heavily on $VCSH_REPO_NAME transporting information both through its value and by being set or not. That will need to be cleaned up. NB: It might be an option to set it to empty as a global and leave it as that, but that seems icky and brittle. Signed-off-by: Richard Hartmann <richih@richih.org>
alerque
reviewed
Jun 23, 2021
| # shellcheck source=/dev/null | ||
| [ -r "$XDG_CONFIG_HOME/vcsh/config.d/$VCSH_REPO_NAME" ] \ | ||
| # TODO: And we rely on $VCSH_REPO_NAME implictly again | ||
| [ -r "$XDG_CONFIG_HOME/vcsh/config.d/${VCSH_REPO_NAME-}" ] \ |
Collaborator
There was a problem hiding this comment.
This will only suceed by a somewhat odd side effect, -r tests specifically for files not directories so it will fail if the values is unset and the path is only to the directory. While the result is correct, the code logic is pretty opaque.
As the assorted comments here note, the active repo(s) name handling should probably be overhauled entirely.
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.
Closes #303.