Merge pull request #1399 from eroullit/codespaces

Codespaces ❤️ Rustlings
This commit is contained in:
liv 2023-02-26 13:05:05 +01:00 committed by GitHub
commit d5b647d5ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,17 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"waitFor": "onCreateCommand",
"onCreateCommand": ".devcontainer/setup.sh",
"updateContentCommand": "cargo build",
"postCreateCommand": "",
"postAttachCommand": {
"server": "rustlings watch"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
}
}

7
.devcontainer/setup.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Update current shell environment variables after install to find rustup
. "$HOME/.cargo/env"
rustup install stable
bash install.sh

View File

@ -66,6 +66,8 @@ If you get a permission denied message, you might have to exclude the directory
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings)
[![Open Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=main)
## Manually ## Manually
Basically: Clone the repository at the latest tag, run `cargo install --path .`. Basically: Clone the repository at the latest tag, run `cargo install --path .`.