mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 13:27:10 -07:00
issue #29 - Add macOS alternative for sha256sum
.
This commit is contained in:
parent
da69b50eb5
commit
b1887e4170
1 changed files with 13 additions and 7 deletions
|
@ -15,20 +15,26 @@ set check_count (math "3 * $test_count")
|
||||||
|
|
||||||
set sdk_init "$HOME/.sdkman/bin/sdkman-init.sh"
|
set sdk_init "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
|
|
||||||
function checksum -a file
|
if [ (uname) = "Linux" ]
|
||||||
sha256sum $file | cut -d " " -f 1
|
function checksum -a file
|
||||||
|
sha256sum $file | cut -d " " -f 1
|
||||||
|
end
|
||||||
|
else # assume macOS
|
||||||
|
function checksum -a file
|
||||||
|
shasum -a 256 $file | cut -d " " -f 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
echo "Testing the sdk wrapper"
|
echo "Testing the sdk wrapper"
|
||||||
set failures 0
|
set failures 0
|
||||||
for sdk_cmd in $test_commands
|
for sdk_cmd in $test_commands
|
||||||
echo " Testing '$sdk_cmd'"
|
echo " Testing '$sdk_cmd'"
|
||||||
bash -c "source \"$sdk_init\" && $sdk_cmd > sout_bash;
|
bash -c "source \"$sdk_init\" && $sdk_cmd > sout_bash;
|
||||||
echo \"\$?\" > status_bash;
|
echo \"\$?\" > status_bash;
|
||||||
echo \"\$PATH\" > path_bash;
|
echo \"\$PATH\" > path_bash;
|
||||||
echo \"\$ANT_HOME\" > anthome_bash"
|
echo \"\$ANT_HOME\" > anthome_bash"
|
||||||
fish -c "$sdk_cmd > sout_fish;
|
fish -c "$sdk_cmd > sout_fish;
|
||||||
echo \"\$status\" > status_fish;
|
echo \"\$status\" > status_fish;
|
||||||
echo \"\$PATH\" > path_fish;
|
echo \"\$PATH\" > path_fish;
|
||||||
echo \"\$ANT_HOME\" > anthome_fish"
|
echo \"\$ANT_HOME\" > anthome_fish"
|
||||||
|
|
||||||
|
@ -52,4 +58,4 @@ rm {sout,status,path}_{bash,fish}
|
||||||
|
|
||||||
echo "Ran $test_count commands with 3 checks each."
|
echo "Ran $test_count commands with 3 checks each."
|
||||||
echo "$failures/$check_count checks failed."
|
echo "$failures/$check_count checks failed."
|
||||||
exit (math $failures != 0)
|
exit (math $failures != 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue