Implement autoenv feature.

Closes issue #38
This commit is contained in:
Raphael Reitzig 2021-02-26 17:17:08 +01:00
parent 61f1cf8efc
commit 6dc108ec03
2 changed files with 10 additions and 1 deletions

View file

@ -83,3 +83,12 @@ if not set -q SDKMAN_DIR; or test (ls -ld "$SDKMAN_DIR" | awk '{print $3}') != (
__fish_sdkman_run_in_bash "source $__fish_sdkman_init"
end
# Set up autoenv
if grep -q "^sdkman_auto_env=true" "$SDKMAN_DIR/etc/config"
function __fish_sdkman_autoenv --on-variable PWD
# Run the (modified) init script, which performs the checks and calls for us!
__fish_sdkman_run_in_bash "source \"$__fish_sdkman_noexport_init\""
set -x SDKMAN_OLD_PWD "$PWD"
end
end