From debd5e2d669fb6b8e910cba61d3b08bdd01228c7 Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Sat, 14 Jul 2018 22:26:38 +0200 Subject: [PATCH 1/3] Do not add uninstalled SDKs to PATH. Fixes issue #10 pt1. --- .travis.yml | 7 +++++-- conf.d/sdk.fish | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e180ba6..08d8e7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,8 @@ install: jobs: include: - - stage: Test Wrapper - script: fish test/wrapper.fish \ No newline at end of file + - stage: General Wrapper Tests + script: fish test/wrapper.fish + - stage: Ticket-specific tests + script: + - sdk install crash 1.3.0; sdk uninstall crash 1.3.0; fish test/10_zombies_new.fish \ No newline at end of file diff --git a/conf.d/sdk.fish b/conf.d/sdk.fish index c03a755..6b59ef0 100644 --- a/conf.d/sdk.fish +++ b/conf.d/sdk.fish @@ -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 From 81eecf50d8a988db6dcc7c279c96ac95d629ae50 Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Sat, 14 Jul 2018 22:32:52 +0200 Subject: [PATCH 2/3] Missing test. --- test/10_zombies_new.fish | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/10_zombies_new.fish diff --git a/test/10_zombies_new.fish b/test/10_zombies_new.fish new file mode 100644 index 0000000..ff928a6 --- /dev/null +++ b/test/10_zombies_new.fish @@ -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 From 9b88775e6cc3333c6e53e9c5c9298e7af5dda16c Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Sat, 14 Jul 2018 22:44:18 +0200 Subject: [PATCH 3/3] Fixes test call --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 08d8e7a..a478138 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,4 @@ jobs: script: fish test/wrapper.fish - stage: Ticket-specific tests script: - - sdk install crash 1.3.0; sdk uninstall crash 1.3.0; fish test/10_zombies_new.fish \ No newline at end of file + - bash -c "sdk install crash 1.3.0; sdk uninstall crash 1.3.0"; fish test/10_zombies_new.fish \ No newline at end of file