Skip to content
Discussion options

You must be logged in to vote

. The easiest way is to check for a special environment variable called CODESPACE_PREBUILD. It's only set to true when a Codespace is being prebuilt, not when someone starts it up on their local machine or just creates a new one. So, in your onCreateCommand or updateContentCommand script, you can just use a simple if statement that checks for that variable. That lets you run all your super-slow setup stuff, like compiling huge projects or grabbing massive files, just once for the prebuilds. Everyone else gets a lightning-fast start without having to sit through all the heavy lifting. Easy peasy.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@neilconway
Comment options

Answer selected by neilconway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform, Question Ask and answer questions about GitHub features and usage
2 participants