diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..e1b2cec1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" + ] + } + } +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 00000000..0e090a86 --- /dev/null +++ b/.devcontainer/setup.sh @@ -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 diff --git a/README.md b/README.md index 14ae2317..e78d1a37 100644 --- a/README.md +++ b/README.md @@ -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 Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=main) + ## Manually Basically: Clone the repository at the latest tag, run `cargo install --path .`.