Skip to content

Commit 8101446

Browse files
authored
Made container creation not DIAF if invalid code is committed.
Due to how container startup happens, if there's a syntax error in some python files the container will DIAF on startup and lead to the Codespace starting up in safe mode. A safe mode container can not push code to a repo, so a student can get themselves into a situation where they can not fix their problems in Codespaces. This patch prevents that situation from happening.
1 parent 9805118 commit 8101446

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// This can be used to network with other containers or the host.
2424
"forwardPorts": [3000, 3001],
2525

26-
"onCreateCommand": "(cp .env.example .env || true) && pipenv install && bash database.sh",
26+
"onCreateCommand": "(cp .env.example .env || echo \".env creation failed\"); (pipenv install || echo \"pipenv install failed\"); (bash database.sh || echo \"database.sh failed\");",
2727
// Use 'postCreateCommand' to run commands after the container is created.
2828
"postCreateCommand": "python docs/assets/greeting.py both > /workspaces/.codespaces/shared/first-run-notice.txt && npm install",
2929

0 commit comments

Comments
 (0)