From 3baa270f7cb75b8159fcf6f0d9057c16913b07b5 Mon Sep 17 00:00:00 2001 From: emisargent <55098699+emisargent@users.noreply.github.com> Date: Fri, 10 Feb 2023 19:30:33 +0000 Subject: [PATCH] Add welcome message --- .devcontainer/devcontainer.json | 11 ++++------- .devcontainer/post-create-command.sh | 2 -- .devcontainer/welcome-message.txt | 7 +++++++ 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 .devcontainer/welcome-message.txt diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 87686727..212cf2da 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,15 +2,12 @@ { "name": "pallets/flask", - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, + // Displays a custom welcome message + "onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt", // Runs the initial setup commands after the container is created. - "postCreateCommand": "sudo chmod +x .devcontainer/post-create-command.sh && .devcontainer/post-create-command.sh" + "postCreateCommand": "sudo chmod +x .devcontainer/post-create-command.sh && .devcontainer/post-create-command.sh", // Activates the virtual environment after the container is started. - // "postStartCommand": ". .venv/bin/activate" - - // Configure tool-specific properties. - // "customizations": {}, + "postStartCommand": ". .venv/bin/activate" } diff --git a/.devcontainer/post-create-command.sh b/.devcontainer/post-create-command.sh index bebfb778..a6b2f9ad 100644 --- a/.devcontainer/post-create-command.sh +++ b/.devcontainer/post-create-command.sh @@ -4,12 +4,10 @@ set -e # Add user's fork as a remote GIT_USER=$(git config user.name) git remote add fork https://github.com/${GIT_USER}/flask -echo "Added remote" # Create and activate a virtualenv python3 -m venv .venv . .venv/bin/activate -echo "Created virtualenv" # Upgrade pip and setuptools python -m pip install --upgrade pip setuptools diff --git a/.devcontainer/welcome-message.txt b/.devcontainer/welcome-message.txt new file mode 100644 index 00000000..e1d0cfd1 --- /dev/null +++ b/.devcontainer/welcome-message.txt @@ -0,0 +1,7 @@ +👋 Welcome to Flask in Codespaces! + +🛠️ Your environment is setup with all the required dependencies and your fork has been added as a remote. + +📝 Wait for the "postCreateCommand" to finish setting things up, then run `. .venv/bin/activate` to activate your virtualenv. + +🚀 To start coding, checkout a branch from the latest release for bugs or docs fixes, or from main for new feature work.