aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2023-02-08 13:46:27 +0100
committerNicholas Rodrigues Lordello <[email protected]>2023-12-12 23:30:26 +0100
commit0c5458f1876d664a1208742d69cd6af05bd341f5 (patch)
tree0decd997c6d99a7ffd2b7aa42343e4a9e39cfce6
parent6c7eafe67e51ee305cbc791ddcbea11c83bd661c (diff)
Add rust codespace installation script
-rwxr-xr-xcodespace/hare.sh5
-rw-r--r--codespace/rust.sh13
2 files changed, 18 insertions, 0 deletions
diff --git a/codespace/hare.sh b/codespace/hare.sh
index 6cf901c..9c9211c 100755
--- a/codespace/hare.sh
+++ b/codespace/hare.sh
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
+if [ "$CODESPACES" != "true" ]; then
+ echo "ERROR: not in a codespace." >&2
+ exit 1
+fi
+
export PREFIX=/opt/hare
gitenter() {
diff --git a/codespace/rust.sh b/codespace/rust.sh
new file mode 100644
index 0000000..eb70aea
--- /dev/null
+++ b/codespace/rust.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+if [ "$CODESPACES" != "true" ]; then
+ echo "ERROR: not in a codespace." >&2
+ exit 1
+fi
+
+curl -s https://sh.rustup.rs | sh -s -- -y --component rust-analyzer
+
+# For some reason, rustup does not create symbolic links to the rust-analyzer
+# binary, so create one.
+source "$HOME/.cargo/env"
+ln -s "$(rustup which rust-analyzer)" ~/.local/bin/rust-analyzer