Makes hack for issue #19 a litte more robust.

Refresh the export-free sdkman-init whenever the
original has changed.
This commit is contained in:
Raphael Reitzig 2018-07-21 16:24:21 +02:00
parent be5efd6aaf
commit 541a69e192

View file

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