diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3c6253d..9441f7c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,6 +4,6 @@ WORKDIR /home/ COPY . . -RUN bash ./setup.sh +RUN bash ./script.sh ENV PATH="/root/.cargo/bin:$PATH" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5352bae..05fe874 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,19 +1,23 @@ { "name": "Codespaces Rust Starter", - "extensions": [ - "cschleiden.vscode-github-actions", - "ms-vsliveshare.vsliveshare", - "matklad.rust-analyzer", - "serayuzgur.crates", - "vadimcn.vscode-lldb" - ], - "dockerFile": "Dockerfile", - "settings": { - "editor.formatOnSave": true, - "terminal.integrated.shell.linux": "/usr/bin/zsh", - "files.exclude": { - "**/CODE_OF_CONDUCT.md": true, - "**/LICENSE": true + "customizations": { + "vscode": { + "extensions": [ + "cschleiden.vscode-github-actions", + "ms-vsliveshare.vsliveshare", + "matklad.rust-analyzer", + "serayuzgur.crates", + "vadimcn.vscode-lldb" + ], + "settings": { + "editor.formatOnSave": true, + "terminal.integrated.shell.linux": "/usr/bin/zsh", + "files.exclude": { + "**/CODE_OF_CONDUCT.md": true, + "**/LICENSE": true + } + } } - } + }, + "dockerFile": "Dockerfile" } \ No newline at end of file diff --git a/.devcontainer/setup.sh b/.devcontainer/script.sh similarity index 74% rename from .devcontainer/setup.sh rename to .devcontainer/script.sh index 31ffb9c..fbe4451 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/script.sh @@ -13,14 +13,19 @@ apt-get install -y \ ## Install rustup and common components curl https://sh.rustup.rs -sSf | sh -s -- -y + +export PATH="/root/.cargo/bin/":$PATH + rustup install nightly rustup component add rustfmt rustup component add rustfmt --toolchain nightly rustup component add clippy rustup component add clippy --toolchain nightly -cargo install cargo-expand -cargo install cargo-edit +# Download cargo-binstall to ~/.cargo/bin directory +curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + +cargo binstall cargo-expand cargo-edit -y ## setup and install oh-my-zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"