rust-analyzer automation

This commit is contained in:
Noah Masur 2021-04-10 13:15:14 -04:00
parent c2b8c29299
commit 76fd99dd2b
2 changed files with 28 additions and 8 deletions

View File

@ -30,15 +30,16 @@ download_rust_analyzer() {
}
install_cargos() {
programs=(
cargo-edit
cargo-whatfeatures
jql
toml-cli
)
for i in "${programs[@]}"; do
cargo install "$i"
set -- \
'cargo-edit'
'cargo-whatfeatures' \
'jql' \
'toml-cli'
for program do
cargo install "$program"
done
echo "cargos ✓"
}
install_rust

19
scripts/update_rust_analyzer Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
update_rust_analyzer() {
if ! (which rust-analyzer > /dev/null)
then
echo "not installed"
else
echo "removing"
rm /usr/local/bin/rust-analyzer
fi
echo "downloading rust analyzer"
rust_analyzer_bin=/usr/local/bin/rust-analyzer
curl -s -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin
chmod +x $rust_analyzer_bin
echo "rust-analyzer ✓"
}
update_rust_analyzer