From 6f14ad76cece4153d759f3882dd9a2523978b36f Mon Sep 17 00:00:00 2001 From: emisargent <55098699+emisargent@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:22:22 +0000 Subject: [PATCH] Update welcome text and add conditional for adding remote fork --- .devcontainer/devcontainer.json | 5 +---- .devcontainer/post-create-command.sh | 12 ++++-------- .devcontainer/welcome-message.txt | 6 ++++-- 3 files changed, 9 insertions(+), 14 deletions(-) mode change 100644 => 100755 .devcontainer/post-create-command.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 212cf2da..e71ea8ce 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,8 +6,5 @@ "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", - - // Activates the virtual environment after the container is started. - "postStartCommand": ". .venv/bin/activate" + "postCreateCommand": "sudo chmod +x .devcontainer/post-create-command.sh && .devcontainer/post-create-command.sh" } diff --git a/.devcontainer/post-create-command.sh b/.devcontainer/post-create-command.sh old mode 100644 new mode 100755 index a6b2f9ad..b64a1c4f --- a/.devcontainer/post-create-command.sh +++ b/.devcontainer/post-create-command.sh @@ -3,7 +3,9 @@ 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 +if [ ! git remote | grep -q "fork" ]; then + git remote add fork https://github.com/${GIT_USER}/flask +fi # Create and activate a virtualenv python3 -m venv .venv @@ -11,16 +13,10 @@ python3 -m venv .venv # Upgrade pip and setuptools python -m pip install --upgrade pip setuptools -echo "Upgraded setuptools" # Install the development dependencies, then install Flask in editable mode pip install -r requirements/dev.txt && pip install -e . -echo "Installed dependencies and Flask" -# Install pre-commit hooks +# Install pre-commit hooks and coverage pre-commit install -echo "Installed pre-commit hooks" - -# Install coverage pip install coverage -echo "Installed coverage" diff --git a/.devcontainer/welcome-message.txt b/.devcontainer/welcome-message.txt index e1d0cfd1..4066fab7 100644 --- a/.devcontainer/welcome-message.txt +++ b/.devcontainer/welcome-message.txt @@ -2,6 +2,8 @@ 🛠️ 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. +📝 Wait for the "postCreateCommand" to finish setting things up. -🚀 To start coding, checkout a branch from the latest release for bugs or docs fixes, or from main for new feature work. +🚀 To start coding: + - run `. .venv/bin/activate` to activate your virtualenv + - run `git checkout -b your-branch-name origin/{main-or-latest-release}` to start working on a new feature or bug fix