diff --git a/conf.d/sdk.fish b/conf.d/sdk.fish index af1ee5d..67be87d 100644 --- a/conf.d/sdk.fish +++ b/conf.d/sdk.fish @@ -41,6 +41,7 @@ function __fish_sdkman_run_in_bash bash -c "$argv[1]; echo -e \"\$?\" > $pipe; env | grep -e '^SDKMAN_\|^PATH' >> $pipe; + env | grep -i -E \"^(`echo \${SDKMAN_CANDIDATES_CSV} | sed 's/,/|/g'`)_HOME\" >> $pipe; echo \"SDKMAN_OFFLINE_MODE=\${SDKMAN_OFFLINE_MODE}\" >> $pipe" # it's not an environment variable! set bashDump (cat $pipe; rm $pipe) diff --git a/test/wrapper.fish b/test/wrapper.fish index 6ba684e..bd95ac0 100644 --- a/test/wrapper.fish +++ b/test/wrapper.fish @@ -23,14 +23,20 @@ echo "Testing the sdk wrapper" set failures 0 for sdk_cmd in $test_commands echo " Testing '$sdk_cmd'" - bash -c "source \"$sdk_init\" && $sdk_cmd > sout_bash; echo \"\$?\" > status_bash; echo "\$PATH" > path_bash" - fish -c "$sdk_cmd > sout_fish; echo \"\$status\" > status_fish; echo "\$PATH" > path_fish" + bash -c "source \"$sdk_init\" && $sdk_cmd > sout_bash; + echo \"\$?\" > status_bash; + echo \"\$PATH\" > path_bash; + echo \"\$ANT_HOME\" > anthome_bash" + fish -c "$sdk_cmd > sout_fish; + echo \"\$status\" > status_fish; + echo \"\$PATH\" > path_fish; + echo \"\$ANT_HOME\" > anthome_fish" # For nicer diffs: one entry per line, sorted string split ":" (cat path_bash) | sort > path_bash string split " " (cat path_fish) | sort > path_fish - for out in sout status path + for out in sout status path anthome if [ (checksum "$out"_bash) != (checksum "$out"_fish) ] echo " - $out bad:" diff "$out"_bash "$out"_fish | sed -e 's/^/ /'