Skip to content

Commit

Permalink
Pint should be run inside or outside of Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Oct 29, 2024
1 parent 8964f63 commit dd95423
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@ INSTALLATION_COMPANY_EMAIL="info(at)company.org"

# Newsletter variables
NEWSLETTER_LIST_ID_NEWSLETTER=# this should come from the mailchimp_lists DB table
NEWSLETTER_LIST_ID_NEWSLETTER_REGISTERED_USERS=# this should come from the mailchimp_lists DB table
NEWSLETTER_LIST_ID_NEWSLETTER_REGISTERED_USERS=# this should come from the mailchimp_lists DB table

# Variables for build tools (e.g. husky git hooks)
USE_DOCKER=true
23 changes: 21 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
# Run Pint to beautify the code
vendor/bin/pint
# .husky/pre-commit

# Load .env variables from the project root, line by line
if [ -f .env ]; then
while IFS='=' read -r key value || [ -n "$key" ]; do
# Skip lines that are comments or do not contain valid key=value format
if echo "$key" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$'; then
# Export each variable without quotes to avoid issues with special characters
export "$key=$value"
fi
done < .env
fi

# Check if USE_DOCKER is set to "true"
if [ "$USE_DOCKER" = "true" ]; then
echo "Running Pint in Docker..."
docker compose exec crowdsourcing_platform_server vendor/bin/pint
else
echo "Running Pint locally..."
vendor/bin/pint
fi

0 comments on commit dd95423

Please sign in to comment.