Skip to content

Commit

Permalink
Do not add uninstalled SDKs to PATH on startup.
Browse files Browse the repository at this point in the history
Fixes issue #10 pt1.
  • Loading branch information
reitzig committed Jul 14, 2018
2 parents 6f86ead + 9b88775 commit 8ca5354
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions conf.d/sdk.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions test/10_zombies_new.fish
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8ca5354

Please sign in to comment.