Update welcome text and add conditional for adding remote fork

This commit is contained in:
emisargent 2023-02-10 21:22:22 +00:00
parent 3baa270f7c
commit 6f14ad76ce
3 changed files with 9 additions and 14 deletions

View file

@ -6,8 +6,5 @@
"onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt", "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. // 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"
} }

12
.devcontainer/post-create-command.sh Normal file → Executable file
View file

@ -3,7 +3,9 @@ set -e
# Add user's fork as a remote # Add user's fork as a remote
GIT_USER=$(git config user.name) 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 # Create and activate a virtualenv
python3 -m venv .venv python3 -m venv .venv
@ -11,16 +13,10 @@ python3 -m venv .venv
# Upgrade pip and setuptools # Upgrade pip and setuptools
python -m pip install --upgrade pip setuptools python -m pip install --upgrade pip setuptools
echo "Upgraded setuptools"
# Install the development dependencies, then install Flask in editable mode # Install the development dependencies, then install Flask in editable mode
pip install -r requirements/dev.txt && pip install -e . 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 pre-commit install
echo "Installed pre-commit hooks"
# Install coverage
pip install coverage pip install coverage
echo "Installed coverage"

View file

@ -2,6 +2,8 @@
🛠️ Your environment is setup with all the required dependencies and your fork has been added as a remote. 🛠️ 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