mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 13:27:10 -07:00
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:
parent
be5efd6aaf
commit
541a69e192
1 changed files with 6 additions and 3 deletions
|
@ -15,9 +15,12 @@ if not test -f "$__fish_sdkman_init"
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hack for issue #19: Create version of sdkman-init that doesn't export
|
# Hack for issue #19:
|
||||||
# any environment variables.
|
# Create version of sdkman-init that doesn't export any environment variables.
|
||||||
if not test -f "$__fish_sdkman_noexport_init"
|
# 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)
|
mkdir -p (dirname $__fish_sdkman_noexport_init)
|
||||||
sed -e 's/^\(\s*\).*\(export\|to_path\).*$/\1:/g' "$__fish_sdkman_init" \
|
sed -e 's/^\(\s*\).*\(export\|to_path\).*$/\1:/g' "$__fish_sdkman_init" \
|
||||||
> $__fish_sdkman_noexport_init
|
> $__fish_sdkman_noexport_init
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue