-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pint should be run inside or outside of Docker
- Loading branch information
1 parent
8964f63
commit dd95423
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |