diff --git a/installer/install-kotlin-lsp.cmd b/installer/install-kotlin-lsp.cmd index 76c0399e..887f1ce5 100644 --- a/installer/install-kotlin-lsp.cmd +++ b/installer/install-kotlin-lsp.cmd @@ -1,8 +1,14 @@ @echo off setlocal -curl -L -o server.zip "https://download-cdn.jetbrains.com/kotlin-lsp/0.252.17811/kotlin-0.252.17811.zip" + +if not %PROCESSOR_ARCHITECTURE%==AMD64 ( + echo %PROCESSOR_ARCHITECTURE% is not supported + exit /b 1 +) + +set version=261.13587.0 + +curl -L -o server.zip "https://download-cdn.jetbrains.com/kotlin-lsp/%version%/kotlin-lsp-%version%-win-x64.zip" call "%~dp0\run_unzip.cmd" server.zip del server.zip - -curl -L -o kotlin-lsp.cmd "https://raw.githubusercontent.com/Kotlin/kotlin-lsp/refs/heads/main/scripts/kotlin-lsp.cmd" diff --git a/installer/install-kotlin-lsp.sh b/installer/install-kotlin-lsp.sh index a5e239ec..60dcab89 100755 --- a/installer/install-kotlin-lsp.sh +++ b/installer/install-kotlin-lsp.sh @@ -2,6 +2,38 @@ set -e -curl -L -o server.zip "https://download-cdn.jetbrains.com/kotlin-lsp/0.252.17811/kotlin-0.252.17811.zip" +os="$(uname -s | tr "[:upper:]" "[:lower:]")" +arch="$(uname -m)" + +case $os in +darwin) + os=mac + ;; +linux) ;; +*) + echo "$os is not supported" + exit 1 + ;; +esac + +case $arch in +aarch64) ;; +arm64) + arch=aarch64 + ;; +x86_64) + arch=x64 + ;; +*) + echo "$arch is not supported" + exit 1 + ;; +esac + +version=261.13587.0 + +curl -L -o server.zip "https://download-cdn.jetbrains.com/kotlin-lsp/${version}/kotlin-lsp-${version}-${os}-${arch}.zip" unzip server.zip rm server.zip +chmod +x kotlin-lsp.sh +ln -s kotlin-lsp.sh kotlin-lsp