From dccaf0056c52d7e85af4debbd8263798a715db1a Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Sun, 6 Jan 2019 18:05:44 +0100 Subject: [PATCH] Re-initialize if current user changed. Fixes issue #25; assumes that every user has their own SDKMAN installation. --- conf.d/sdk.fish | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/conf.d/sdk.fish b/conf.d/sdk.fish index 3e25a7d..aeb54ea 100644 --- a/conf.d/sdk.fish +++ b/conf.d/sdk.fish @@ -74,9 +74,10 @@ function __fish_sdkman_run_in_bash return $sdkStatus end -# If this is a subshell of a(n initialized) fish, no initialization -# necessary. Otherwise: -if not set -q SDKMAN_DIR +# If this is a subshell of a(n initialized) fish owned by the same user, +# no initialization necessary. +# Otherwise: +if not set -q SDKMAN_DIR; or test (stat -c "%U" $SDKMAN_DIR) != (whoami) __fish_sdkman_run_in_bash "source $__fish_sdkman_init" end