From 7a5036d9570f803bbebc32eac0939fe388b50f76 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Fri, 8 Dec 2023 15:34:00 +0000 Subject: [PATCH 1/2] move postCreateCommands to a separate file --- .devcontainer/devcontainer.json | 6 +----- .devcontainer/postCreateCommand.sh | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100755 .devcontainer/postCreateCommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a0c531ee..961135ed 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -40,11 +40,7 @@ "forwardPorts": [ 8080 ], - "postCreateCommand": [ - "composer install --no-dev --optimize-autoloader", - "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html", - "npm install --global nyc" - ], + "postCreateCommand": ".devcontainer/postCreateCommand.sh", // alternatiuve: apache2ctl start (but requires root) "postAttachCommand": "php -S 0.0.0.0:8080" } diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000..41b61ef9 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +composer install --no-dev --optimize-autoloader +sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html +npm install --global nyc From 10c6841f8a26277ff69b29fd6a6d3f6cdd2f93ed Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Fri, 8 Dec 2023 15:31:45 -0700 Subject: [PATCH 2/2] Update .devcontainer/postCreateCommand.sh Co-authored-by: rugk --- .devcontainer/postCreateCommand.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 41b61ef9..dd613dbe 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh composer install --no-dev --optimize-autoloader sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html