Skip to content

Commit

Permalink
[Add] DevContainer postCreate script to handle further setup,
Browse files Browse the repository at this point in the history
[Add] Automatically install Composer dependencies in DevContainer
  • Loading branch information
bumbummen99 committed Nov 24, 2024
1 parent 3184754 commit fa98d9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fa98d9e

Please sign in to comment.