From d2b859a7ab79a46dbf794bf4504f66ea8eb32e5d Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Sat, 27 Jan 2024 12:58:43 +0100 Subject: [PATCH] Switch installation of pre-commit to postCreateCommand --- .devcontainer/Dockerfile | 3 +-- .devcontainer/devcontainer.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 04a937c7..f8debacc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -5,8 +5,7 @@ FROM mcr.microsoft.com/devcontainers/rust:1 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends lld python3-pip \ && rustup update \ - && rustup toolchain install nightly --profile minimal --component clippy,rustfmt \ - && pip3 install --no-cache-dir pre-commit + && rustup toolchain install nightly --profile minimal --component clippy,rustfmt COPY config /root/.cargo/config RUN cargo install --locked bacon cargo-readme \ && rm -rf ~/.cargo/registry diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1693bd6c..902cc83a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,7 @@ ], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pre-commit install --install-hooks", + "postCreateCommand": "pip install --user --upgrade pre-commit && pre-commit install --install-hooks", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "root",