From 55b2c3f80f0ef8e05814167637c4278fe0c2c01e Mon Sep 17 00:00:00 2001 From: "Kees C. Bakker" Date: Wed, 11 Dec 2024 09:56:12 +0000 Subject: [PATCH] fix: update dev container - Ship new NPM version. - Make trusting the git repo part of the profile startup. --- .devcontainer/.profile | 4 ++++ .devcontainer/Dockerfile | 9 ++++++++- .devcontainer/startup.sh | 5 ----- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .devcontainer/.profile diff --git a/.devcontainer/.profile b/.devcontainer/.profile new file mode 100644 index 0000000..de94ce6 --- /dev/null +++ b/.devcontainer/.profile @@ -0,0 +1,4 @@ +# trust the repo +# fixes: +# - fatal: detected dubious ownership in repository at '/workspaces/bot-zero'. +git config --global --add safe.directory "$PWD" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 09cc3a5..f680bdd 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,15 @@ FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye # Install the npm packages globally -RUN npm install -g npm@10.7.0 \ +RUN npm install -g npm@10.9.2 \ && npm install -g npm-check-updates COPY ./startup.sh / RUN chmod +x /startup.sh + +# Append the profile to the current .bashrc and .zshrc files +# this makes sure we keep the current behavior like colors and aliases +COPY ./.profile /tmp/.profile +RUN cat /tmp/.profile >> /home/node/.bashrc && \ + cat /tmp/.profile >> /home/node/.zshrc && \ + rm /tmp/.profile diff --git a/.devcontainer/startup.sh b/.devcontainer/startup.sh index 27a4b33..5cdc577 100644 --- a/.devcontainer/startup.sh +++ b/.devcontainer/startup.sh @@ -1,10 +1,5 @@ #!/bin/sh -# trust the repo -# fixes: -# - fatal: detected dubious ownership in repository at '/workspaces/bot-zero'. -git config --global --add safe.directory "$PWD" - # install NPM packages echo "" echo "Installing packages..."