38 lines
942 B
Plaintext
38 lines
942 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
SERVER=$1
|
||
|
VERSION=$2
|
||
|
|
||
|
UNAME=$(sh -c 'uname 2>/dev/null || echo Unknown')
|
||
|
if [[ "$UNAME" == "Windows_NT" ]]; then
|
||
|
UNAME="Windows"
|
||
|
fi
|
||
|
|
||
|
case $SERVER in
|
||
|
jdtls)
|
||
|
if [ -z "$VERSION" ]; then
|
||
|
VERSION="1.4.0"
|
||
|
fi
|
||
|
FILE_NAME=$(curl https://download.eclipse.org/jdtls/milestones/$VERSION/latest.txt)
|
||
|
wget -O - https://download.eclipse.org/jdtls/milestones/$VERSION/$FILE_NAME > /tmp/jdtls.tar.gz
|
||
|
mkdir -p $HOME/lsp/java/jdtls
|
||
|
tar -xf /tmp/jdtls.tar.gz -C $HOME/lsp/java/jdtls
|
||
|
;;
|
||
|
omnisharp)
|
||
|
if [ -z "$VERSION" ]; then
|
||
|
VERSION="v1.37.16"
|
||
|
fi
|
||
|
case $UNAME in
|
||
|
Linux)
|
||
|
FILE_NAME="omnisharp-linux-x64.tar.gz"
|
||
|
;;
|
||
|
Darwin)
|
||
|
FILE_NAME="omnisharp-osx.tar.gz"
|
||
|
;;
|
||
|
esac
|
||
|
wget -O - https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$VERSION/$FILE_NAME > /tmp/omnisharp.tar.gz
|
||
|
mkdir -p $HOME/lsp/dotnet/omnisharp
|
||
|
tar -xf /tmp/omnisharp.tar.gz -C $HOME/lsp/dotnet/omnisharp
|
||
|
;;
|
||
|
esac
|