reitzig / sdkman-for-fish

Adds support for SDKMAN! to fish
MIT License
280 stars 13 forks source link

Account for SDKMAN! being installed at custom path #34

Closed avierr closed 1 year ago

avierr commented 4 years ago

I usually have sdkman installer in /Users/Shared/sdkman directory so that two user can share the same sdkman instance.

I only have to set the sdkman path in my profile/rc file per user.

but seems like variable is hardcoded, https://github.com/reitzig/sdkman-for-fish/blob/c9fd8d58f2972c8664db6645ea37a3e35f2f5afb/conf.d/sdk.fish#L10

reitzig commented 4 years ago

You mean we should use SDKMAN_DIR instead? That makes sense to me, but I'd have to look at it more closely to not break the case where sdkman-for-fish installs sdkman.

FWIW, I think this is a new feature in SDKMAN! 5.8.x; cf. #35

tmysik commented 3 years ago

I just needed to workaround this by setting set -g __fish_sdkman_init "/my/path/to/sdkman/bin/sdkman-init.sh" in ~/.config/fish/config.fish. Seems to be working fine.

Note: I have installed SDKMAN! (in my custom directory) before sdkman-for-fish and it wanted me to download and install it again.

reitzig commented 3 years ago

Thanks! I figured it should be that simple, but I'll have to figure out how to handle

Maybe it'll have to be an (optional) setting with HOME as the default, but I would prefer to have an automatism.

tmysik commented 3 years ago

@reitzig Maybe it could be interactive? Now, you are checking some variable and do installation if not set. What if you asked user what to do, whether SDKMAN! was already installed, etc. if such a variable is not set?

reitzig commented 1 year ago

It'll be like this: If globale fish variable __sdkman_custom_dir is set, we will respect its value.

That is, if you have a custom installation, add

set -g __sdkman_custom_dir /your/path

to .config/fish/conf.d/config_sdk.fish.

cf. corner_cases.feature#14

Sorry for the long wait, but it's done now! 🙃