From 85885da8b4e7f747d16d9947c3be531b4adff972 Mon Sep 17 00:00:00 2001 From: slhmy Date: Wed, 17 Jan 2024 18:15:56 +0800 Subject: [PATCH] Perf codespace experience (#135) --- .devcontainer/devcontainer.json | 13 +++++++++++++ .gitignore | 3 ++- .vscode/extensions.json | 6 +++++- ENV_SETUP.bash => scripts/env_setup.bash | 4 +++- 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json rename ENV_SETUP.bash => scripts/env_setup.bash (64%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f73d386 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "postCreateCommand": "${containerWorkspaceFolder}/scripts/env_setup.bash", + "customizations": { + "vscode": { + "extensions": [ + "tamasfe.even-better-toml", + "rust-lang.rust-analyzer", + "mads-hartmann.bash-ide-vscode" + ] + } + } +} diff --git a/.gitignore b/.gitignore index 3d3ef21..d4d3ffe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target/ tmp/ !tmp/.gitkeep -Cargo.lock \ No newline at end of file +Cargo.lock +scripts/rustup.sh \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5860e8e..8d55fd7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,7 @@ { - "recommendations": ["swellaby.rust-pack", "lizebang.bash-extension-pack", "pkief.material-icon-theme"] + "recommendations": [ + "tamasfe.even-better-toml", + "rust-lang.rust-analyzer", + "mads-hartmann.bash-ide-vscode" + ] } diff --git a/ENV_SETUP.bash b/scripts/env_setup.bash similarity index 64% rename from ENV_SETUP.bash rename to scripts/env_setup.bash index 6d242e9..0c739e6 100755 --- a/ENV_SETUP.bash +++ b/scripts/env_setup.bash @@ -10,4 +10,6 @@ if [[ $CUR_SYSTEM =~ $UBUNTU_FLAG ]];then sudo apt install -y libseccomp-dev gcc fi -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh \ No newline at end of file +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >> scripts/rustup.sh +chmod +x scripts/rustup.sh +./scripts/rustup.sh -y \ No newline at end of file