From fa98d9ef5d2f742edaac42d60280dda7ba7ce401 Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Sun, 24 Nov 2024 07:56:09 +0100 Subject: [PATCH] [Add] DevContainer postCreate script to handle further setup, [Add] Automatically install Composer dependencies in DevContainer --- .devcontainer/devcontainer.json | 4 ++-- .devcontainer/postCreate.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 .devcontainer/postCreate.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8dce16f..9380ae9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,10 +17,10 @@ "onecentlin.laravel-blade" ] } - } + }, // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" + "postCreateCommand": ".devcontainer/postCreate.sh" // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh new file mode 100755 index 0000000..72e4837 --- /dev/null +++ b/.devcontainer/postCreate.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Install dependencies using Composer in case they are missing +if [ ! -f composer.lock ]; then + composer install +fi \ No newline at end of file