Do not add uninstalled SDKs to PATH on startup.

Fixes issue #10 pt1.
This commit is contained in:
Raphael Reitzig 2018-07-14 22:50:26 +02:00
commit 8ca535467f
3 changed files with 16 additions and 4 deletions

View file

@ -17,5 +17,8 @@ install:
jobs:
include:
- stage: Test Wrapper
script: fish test/wrapper.fish
- stage: General Wrapper Tests
script: fish test/wrapper.fish
- stage: Ticket-specific tests
script:
- bash -c "sdk install crash 1.3.0; sdk uninstall crash 1.3.0"; fish test/10_zombies_new.fish

View file

@ -17,8 +17,8 @@ if test -f "$sdkman_init"
# This is a subshell, SDKMAN! binaries already in path.
case '*'
# No SDKMAN! in PATH yet, so add candidate binaries
for ITEM in $HOME/.sdkman/candidates/* ;
set -gx PATH $PATH $ITEM/current/bin
for ITEM in $HOME/.sdkman/candidates/*/current ;
set -gx PATH $PATH $ITEM/bin
end
end

9
test/10_zombies_new.fish Normal file
View file

@ -0,0 +1,9 @@
switch "$PATH"
case "*sdkman/candidates/crash/*"
echo "Uninstalled candidate in PATH"
sdk list crash | head -10
echo $PATH
exit 1
case "*"
echo "OKAY"
end