sdkman-for-fish icon indicating copy to clipboard operation
sdkman-for-fish copied to clipboard

Account for SDKMAN! being installed at custom path

Open solidpulse opened this issue 5 years ago • 4 comments

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

solidpulse avatar May 14 '20 14:05 solidpulse

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

reitzig avatar May 14 '20 15:05 reitzig

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.

tmysik avatar Jul 02 '20 09:07 tmysik

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

  • not knowing SDKMAN_DIR without running it first (critical), and
  • installing it to a custom location (nice to have).

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

reitzig avatar Jul 02 '20 09:07 reitzig

@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?

tmysik avatar Jul 02 '20 13:07 tmysik

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! 🙃

reitzig avatar Jun 26 '23 22:06 reitzig