From f94f365e146fa37b66e5c2e6b392d282f8c049f1 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Thu, 1 Dec 2022 14:05:10 +0100 Subject: [PATCH 1/6] dev: add basic devcontainer settings file Theses settings files are the base needed to declare and bootstrap development environment on codespaces Signed-off-by: Emmanuel Roullit --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ .devcontainer/setup.sh | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/setup.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0fd90cc --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "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 0000000..e50bde3 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash +curl https://sh.rustup.rs -sSf | sh -s -- -y +rustup install stable +bash install.sh From 4972bede48001fb4ae6838a98c2bfce2399d7293 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Thu, 1 Dec 2022 14:30:03 +0100 Subject: [PATCH 2/6] dev: source cargo env files to find rustup Signed-off-by: Emmanuel Roullit --- .devcontainer/setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index e50bde3..0e090a8 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -1,4 +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 From b653d4848a52701d2240f130ab74c158dd5d7069 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Thu, 1 Dec 2022 16:15:13 +0100 Subject: [PATCH 3/6] doc: add hint on how to create codespace Signed-off-by: Emmanuel Roullit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 38972a4..f1adae8 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,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 up Rustlings in [Codespaces](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository) + ## Manually Basically: Clone the repository at the latest tag, run `cargo install --path .`. From 1afc7ed8c53a2845f557e88b31e1f45f2f28abe4 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Sat, 25 Feb 2023 17:20:31 +0100 Subject: [PATCH 4/6] Update README.md Create Rustlings Codespace in one click --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 383a96e..3054114 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ 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 up Rustlings in [Codespaces](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository) +[![Open Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=master) ## Manually From 351e4e2460338785a474d66fd8c2ea1a324d2104 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Sat, 25 Feb 2023 17:56:00 +0100 Subject: [PATCH 5/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0fd90cc..e1b2cec 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", + "image": "mcr.microsoft.com/devcontainers/universal:2-linux", "waitFor": "onCreateCommand", "onCreateCommand": ".devcontainer/setup.sh", "updateContentCommand": "cargo build", From 86f8fa8e6e87274543a41697c2fdc810fbdbc079 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Sat, 25 Feb 2023 17:57:34 +0100 Subject: [PATCH 6/6] Update README.md Fix refs from master to main --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3054114..e78d1a3 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ 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=master) +[![Open Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=rust-lang%2Frustlings&ref=main) ## Manually