From 1cc6168b2d796f504c97e12cd88e4db9257148a6 Mon Sep 17 00:00:00 2001 From: slhmy Date: Wed, 17 Jan 2024 08:09:47 +0000 Subject: [PATCH 1/2] Try customize devcontainer --- .devcontainer/devcontainer.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..7440760 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "onCreateCommand": "${containerWorkspaceFolder}/ENV_SETUP.bash" +} \ No newline at end of file From 3d576f117e416f80973b062c1614897b5a676a55 Mon Sep 17 00:00:00 2001 From: slhmy Date: Wed, 17 Jan 2024 16:12:35 +0800 Subject: [PATCH 2/2] Update devcontainer.json --- .devcontainer/devcontainer.json | 13 +++++++++++-- .gitignore | 3 ++- .vscode/extensions.json | 6 +++++- ENV_SETUP.bash => scripts/env_setup.bash | 4 +++- 4 files changed, 21 insertions(+), 5 deletions(-) rename ENV_SETUP.bash => scripts/env_setup.bash (64%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7440760..f73d386 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,13 @@ { "image": "mcr.microsoft.com/devcontainers/universal:2", - "onCreateCommand": "${containerWorkspaceFolder}/ENV_SETUP.bash" -} \ No newline at end of file + "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