Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest fish users to install sdkman-for-fish #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions app/views/install.scala.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,46 @@ if [[ -z $(grep 'sdkman-init.sh' "$sdkman_zshrc") ]]; then
echo "Updated existing ${sdkman_zshrc}"
fi

if [[ -d "${HOME}"/.config/fish && ! -f "${HOME}"/.config/fish/conf.d/sdk.fish ]]; then
echo "It seems you have fish installed. Unfortunately, SDKMAN! does not work with fish out of the box."

while true; do
read -p "Install third-party support (fisher, sdkman-for-fish) now? [yN]: " yn
case $yn in
[Yy]* )
if [[ -z ${XDG_CONFIG_HOME} ]]; then
XDG_CONFIG_HOME="${HOME}/.config"
fi

if [[ ! -f "${HOME}"/.config/fish/functions/fisher.fish ]]; then
mkdir -p "${XDG_CONFIG_HOME}"/fish/functions/

echo -n "Downloading fisher ... "
curl_out=$(curl -fsSL \
-o "${XDG_CONFIG_HOME}"/fish/functions/fisher.fish \
--create-dirs https://git.io/fisher 2>&1)

if [[ ${?} -gt 0 ]]; then
echo "FAILED"
echo "${curl_out}"
break
else
echo "OKAY"
fi

unset curl_out
fi

fish -c "fisher add reitzig/sdkman-for-fish"
break
;;
* )
break
;;
esac
done
fi

echo -e "\n\n\nAll done!\n\n"

echo "Please open a new terminal, or run the following in the existing one:"
Expand Down