Files
vim-lsp-settings-mirror/installer/install-rust-analyzer.sh
Yasuhiro Matsumoto 38c3b8dfe2 Pin GitHub release installer versions
Replaces releases/latest/download/... with releases/download/$version/...
for 19 installers (38 files) so each script has an extractable version=
or set VERSION= line that update-installer-versions.sh can rewrite.

Drive-by fixes folded in:
- install-markdown-oxide.cmd pointed at atusy/markdown-oxide (404). Repointed
  to Feel-ix-343/markdown-oxide upstream which does publish a Windows binary.
- install-systemd-lsp.{sh,cmd} had v2025.07.10 hardcoded mid-URL; pinned to
  current latest v2026.04.21.
- install-typos-lsp.{sh,cmd} dropped the curl-redirect-to-learn-the-version
  dance in favor of a pinned tag.
- install-omnisharp-lsp.{sh,cmd}: the script's local 'version' (dotnet --version
  output) was renamed to 'dotnet_version' so the pinned release version can
  coexist without shadowing.

biome and oxlint are left unchanged: biome's tag (@biomejs/biome@X.Y.Z) needs
URL encoding, and oxc-project/oxc publishes parallel apps_v*/crates_v* streams
where releases/latest is ambiguous. Both would need ad-hoc handling.
2026-05-21 11:58:07 +00:00

52 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -e
version="2026-05-18"
os=$(uname -s | tr "[:upper:]" "[:lower:]")
arch="$(uname -m)"
case $os in
linux)
if [ "$arch" = "x86_64" ]; then
platform="x86_64-unknown-linux-gnu"
elif [ "$arch" = "aarch64" ]; then
platform="aarch64-unknown-linux-gnu"
else
echo "unknown architecture: $arch"
exit 1
fi
;;
darwin)
if [ "$arch" = "x86_64" ]; then
platform="x86_64-apple-darwin"
elif [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then
platform="aarch64-apple-darwin"
else
echo "unknown architecture: $arch"
exit 1
fi
;;
mingw64_nt*)
if [ "$arch" = "x86_64" ]; then
platform="x86_64-pc-windows-msvc"
elif [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then
platform="aarch64-pc-windows-msvc"
else
echo "unknown architecture: $arch"
exit 1
fi
;;
*)
echo "unknow platform: $os"
exit 1
;;
esac
curl -L -o "rust-analyzer-$platform.gz" "https://github.com/rust-analyzer/rust-analyzer/releases/download/$version/rust-analyzer-$platform.gz"
gzip -d "rust-analyzer-$platform.gz"
mv rust-analyzer-$platform rust-analyzer
chmod +x rust-analyzer