feat: offer basic support for fish for Java commands#2773
feat: offer basic support for fish for Java commands#2773alexarchambault merged 2 commits intocoursier:mainfrom
Conversation
|
Hmm... coursier doesn't use case app yet? I remember there was a lot of things done there for completions etc. (not for fish though yet) |
It does use it, but it doesn't have fish completions. Completions are also a whole other battle. I updated the description to make it clear, but this isn't offering completions, but rather just supporting being able to manage your java installation with fish. I just got a new computer and decided to try to use coursier instead of sdkman to manage my java stuff, so these are basically the painpoints I'm hitting on 😆 |
alexarchambault
left a comment
There was a problem hiding this comment.
Nice! If you feel like it, you might want to add non-regression tests to ProfileUpdaterTests
Yes let me try to add something, because with the changed logic, the shell is now picked up in various places where it wasn't before and now on fish the tests actually don't pass anymore on a machine using fish, since all the others are testing for non-fish stuff. Alright, added some tests! Which is good because it caused me to see that I actually had an issue 😄 |
alexarchambault
left a comment
There was a problem hiding this comment.
Looks great, thanks @ckipp01!
This PR offers some basic support for fish users that want to use coursier to manage their Java installations. Before this everything was
.profileish based, which isn't supported by fish. It works a bit differently and fish users basically have the choice to only use the CLI when setting env variables with things likeset -Ux JAVA_HOME <whatever>or then never have to update any files, or they can update their fish configs, which is typically located atXDG_CONFIG_HOMEunderfish/fish.config. Since we already had everything set up to add to files I went that route.So this offers support for
--env, for example:It also supports the
--disableflag. And finally it can now update your fish config when you're using--setup. For example:And you'll then notice your fish config has the following:
Which correct sets your
JAVA_HOME:All the existing behavior for non-fish shell users should remain the same.