download-rust-analyzer

 1#!/bin/bash
 2
 3set -e
 4
 5export RUST_ANALYZER_URL="https://github.com/rust-analyzer/rust-analyzer/releases/download/2022-01-24/"
 6
 7function download {
 8    local filename="rust-analyzer-$1"
 9    curl -L $RUST_ANALYZER_URL/$filename.gz | gunzip > vendor/bin/$filename
10    chmod +x vendor/bin/$filename
11}
12
13mkdir -p vendor/bin
14download "x86_64-apple-darwin"
15download "aarch64-apple-darwin"
16
17cd vendor/bin
18lipo -create rust-analyzer-* -output rust-analyzer
19rm rust-analyzer-*