- Added TypeScript build info for frontend. - Created Vite configuration for React application. - Implemented pre-commit hook to run checks before commits. - Set up PostgreSQL Dockerfile with PostGIS support and initialization scripts. - Added database creation script for PostgreSQL with necessary extensions. - Established Python project configuration with dependencies and development tools. - Developed pre-commit script to enforce code quality checks for backend and frontend. - Created PowerShell script to set up Git hooks path.
27 lines
739 B
Bash
27 lines
739 B
Bash
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
psql_cli=("${psql[@]}")
|
|
|
|
if [[ ${#psql_cli[@]} -eq 0 ]]; then
|
|
psql_cli=(psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --no-password)
|
|
fi
|
|
|
|
"${psql_cli[@]}" --dbname="$POSTGRES_DB" <<-EOSQL
|
|
CREATE EXTENSION IF NOT EXISTS postgis;
|
|
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
|
EOSQL
|
|
|
|
existing_db=$("${psql_cli[@]}" --dbname=postgres -tAc "SELECT 1 FROM pg_database WHERE datname = 'railgame_test';")
|
|
|
|
if [[ "$existing_db" != "1" ]]; then
|
|
"${psql_cli[@]}" --dbname=postgres <<-EOSQL
|
|
CREATE DATABASE railgame_test OWNER ${POSTGRES_USER};
|
|
EOSQL
|
|
fi
|
|
|
|
"${psql_cli[@]}" --dbname=railgame_test <<-EOSQL
|
|
CREATE EXTENSION IF NOT EXISTS postgis;
|
|
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
|
EOSQL
|