diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 889c31b..dd99073 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,7 +9,9 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Uncomment the next line to run commands after the container is created. - "postCreateCommand": "jekyll --version && cd docs && bundle install", + "postCreateCommand": "zsh scripts/devcontainer/postcreatecommand.sh", + "postStartCommand": "zsh scripts/devcontainer/poststartcommand.sh", + "forwardPorts": [4000], // Configure tool-specific properties. "customizations": { "codespaces": { diff --git a/scripts/devcontainer/postcreatecommand.sh b/scripts/devcontainer/postcreatecommand.sh new file mode 100755 index 0000000..aefabaf --- /dev/null +++ b/scripts/devcontainer/postcreatecommand.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +rm -Rf ~/.asdf +git clone https://github.com/asdf-vm/asdf.git ~/.asdf; +chmod +x ~/.asdf/asdf.sh; +echo '. $HOME/.asdf/asdf.sh' >> ~/.zshrc +echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc + +source ~/.zshrc + +echo 'asdf setup complete' + +make config + +jekyll --version && cd docs && bundle install + +echo 'jekyll setup complete' diff --git a/scripts/devcontainer/poststartcommand.sh b/scripts/devcontainer/poststartcommand.sh new file mode 100755 index 0000000..31a110d --- /dev/null +++ b/scripts/devcontainer/poststartcommand.sh @@ -0,0 +1,3 @@ +#!/bin/bash +source ~/.zshrc +make config