diff options
| -rwxr-xr-x | codespace/hare.sh | 5 | ||||
| -rw-r--r-- | codespace/rust.sh | 13 |
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 |
