fix!: align Fish entrypoint behaviour with other shells#1524
Merged
Conversation
jthegedus
reviewed
Mar 29, 2023
jthegedus
reviewed
Mar 29, 2023
| test/*.bats | ||
|
|
||
| # check .fish files | ||
| fish_indent --write ./**/*.fish |
Contributor
There was a problem hiding this comment.
Since this is run locally, it would be ideal to check Fish is available or error with a warning to the user that it is required.
Even more ideal would be to get fish_indent as a standalone CLI tool and manage it with our .tool-versions file so people get the same experience as with shellcheck and shfmt in this repo.
A separate Issue tracking this would suffice I would say.
jthegedus
approved these changes
Mar 29, 2023
jthegedus
left a comment
Contributor
There was a problem hiding this comment.
I don't use fish anymore so haven't tested this locally myself, but LGTM
Contributor
|
Merging to get people testing this. |
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.
Summary
As per this comment, this matches the behavior of Fish with Bash, Nushell, and all the other shells. Along with a few other things
There were some bugs with the previous Fish implementation that are now fixed:
ASDF_DIRwas set to an empty string, the value was used (unlike in Bash/Zsh, Elvish, Nushell, which replaces it with a correct one)ASDF_DIRis now always an absolute path to the asdf directory (previously it could have been a.). (Since it's an absolute path, we now export it so that asdf can use it instead of recalculating)PATHorfish_user_paths(throughfish_add_path) would be modified. Now, only the latter is potentially modifiedstatusbuiltin like-fare now deprecated in Fish and have been replaced with the alternative (stringfilename)It seems that
fish_add_pathpotentially modifies the placement of an entry in$fish_user_paths, even if--moveis not specified, so I opted to prepend to$fish_user_pathsmanually, so the behavior is consistent with all the other shells.Now we also use
fish_indentto make sure Fish scripts are formatted nicely (even if we have relatively few of them)