mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-06-16 09:20:52 -07:00
Merge branch 'dev'
This commit is contained in:
commit
ba1ab563a3
6 changed files with 59 additions and 27 deletions
5
.editorconfig
Normal file
5
.editorconfig
Normal file
|
@ -0,0 +1,5 @@
|
|||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
test/*_fish
|
||||
test/*_bash
|
|
@ -2,10 +2,6 @@ env:
|
|||
- FISH=release-2
|
||||
- FISH=release-3
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- env: FISH=release-3
|
||||
|
||||
sudo: required
|
||||
before_install:
|
||||
- sudo add-apt-repository -y ppa:fish-shell/${FISH}
|
||||
|
@ -19,9 +15,10 @@ install:
|
|||
- cp completions/* "${HOME}"/.config/fish/completions/
|
||||
- cp conf.d/* "${HOME}"/.config/fish/conf.d/
|
||||
- cp functions/* "${HOME}"/.config/fish/functions/
|
||||
- uname -a; fish --version
|
||||
|
||||
script:
|
||||
- ruby test/completion.rb
|
||||
- fish test/wrapper.fish
|
||||
- fish test/reinitialize.fish
|
||||
- bash -c "sdk install crash 1.3.0; sdk uninstall crash 1.3.0"; fish test/10_zombies_new.fish
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Makes command `sdk` from [SDKMAN!] available in fish.
|
||||
Also provides auto-completion and adds binaries from installed SDKs to the PATH.
|
||||
|
||||
Tested with fish 2.7.1 and SDKMAN! 5.7.3.
|
||||
Tested with fish 2.7.1 and 3.0.2, and SDKMAN! 5.7.3.
|
||||
|
||||
:warning: Tests indicate that fish 3.x is incompatible.
|
||||
|
||||
|
|
25
test/reinitialize.fish
Executable file
25
test/reinitialize.fish
Executable file
|
@ -0,0 +1,25 @@
|
|||
# If either of
|
||||
# - $SDKMAN_DIR is unset
|
||||
# - $SDKMAN_DIR points to a directory not owned by the current user
|
||||
# is true, sdkman-for-fish should run sdkman's init script.
|
||||
|
||||
# Assumes sdkman-for-fish is installed
|
||||
set proper_value "$SDKMAN_DIR"
|
||||
|
||||
begin
|
||||
set -e SDKMAN_DIR
|
||||
set in_new_shell (fish -lc 'echo $SDKMAN_DIR')
|
||||
if [ "$in_new_shell" != "$proper_value" ]
|
||||
echo "SDKMAN_DIR initialized to $in_new_shell instead of $proper_value"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
set SDKMAN_DIR "/" # belongs to root, who hopefully doesn't run this
|
||||
set in_new_shell (fish -lc 'echo $SDKMAN_DIR')
|
||||
if [ "$in_new_shell" != "$proper_value" ]
|
||||
echo "SDKMAN_DIR reinitialized to $in_new_shell instead of $proper_value"
|
||||
exit 1
|
||||
end
|
||||
end
|
|
@ -34,7 +34,10 @@ for sdk_cmd in $test_commands
|
|||
|
||||
# For nicer diffs: one entry per line, sorted
|
||||
string split ":" (cat path_bash) | sort > path_bash
|
||||
string split " " (cat path_fish) | sort > path_fish
|
||||
string split ":" (cat path_fish) \
|
||||
| string split " " \
|
||||
| sort > path_fish
|
||||
# split by spaces for fish 2.*
|
||||
|
||||
for out in sout status path anthome
|
||||
if [ (checksum "$out"_bash) != (checksum "$out"_fish) ]
|
||||
|
@ -52,4 +55,4 @@ rm {sout,status,path}_{bash,fish}
|
|||
|
||||
echo "Ran $test_count commands with 3 checks each."
|
||||
echo "$failures/$check_count checks failed."
|
||||
exit (math $failures != 0)
|
||||
exit $failures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue