Skip to content

Commit

Permalink
Re-initialize if current user changed.
Browse files Browse the repository at this point in the history
Fixes issue #25; assumes that every user has their own SDKMAN installation.
  • Loading branch information
reitzig committed Jan 6, 2019
1 parent 083d2d3 commit dccaf00
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions conf.d/sdk.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dccaf00

Please sign in to comment.