From 541a69e192ba018ff2399d9e696edcb43a811a64 Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Sat, 21 Jul 2018 16:24:21 +0200 Subject: [PATCH] Makes hack for issue #19 a litte more robust. Refresh the export-free sdkman-init whenever the original has changed. --- conf.d/sdk.fish | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/conf.d/sdk.fish b/conf.d/sdk.fish index 224709a..af1ee5d 100644 --- a/conf.d/sdk.fish +++ b/conf.d/sdk.fish @@ -15,9 +15,12 @@ if not test -f "$__fish_sdkman_init" exit 0 end -# Hack for issue #19: Create version of sdkman-init that doesn't export -# any environment variables. -if not test -f "$__fish_sdkman_noexport_init" +# Hack for issue #19: +# Create version of sdkman-init that doesn't export any environment variables. +# Refresh if sdkman-init changed. +if begin not test -f "$__fish_sdkman_noexport_init"; + or env test "$__fish_sdkman_init" -nt "$__fish_sdkman_noexport_init" + end mkdir -p (dirname $__fish_sdkman_noexport_init) sed -e 's/^\(\s*\).*\(export\|to_path\).*$/\1:/g' "$__fish_sdkman_init" \ > $__fish_sdkman_noexport_init