Skip to content

Commit 53df88c

Browse files
epicserveclaude
andcommitted
Fix start_new_project script to work on Linux and enhance CI verification
The script was using macOS-specific sed syntax (sed -i '') that fails on Linux. Updated to use portable sed -i.bak syntax that works on both platforms. Added set -e for better error handling and enhanced CI with explicit verification steps to ensure sed replacements succeed. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent b33790e commit 53df88c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ jobs:
6666
- name: Test install script
6767
run: |
6868
./scripts/start_new_project "example" ${GITHUB_REF#refs/heads/} 1 ${{ env.BUILD_DIR }}
69+
- name: Verify project files were updated correctly
70+
working-directory: ${{ env.BUILD_DIR }}
71+
run: |
72+
echo "Verifying compose.yml was updated..."
73+
grep -q "image: example" compose.yml || (echo "ERROR: compose.yml not updated correctly" && exit 1)
74+
! grep -q "image: epicserve/django-base-site" compose.yml || (echo "ERROR: compose.yml still contains template text" && exit 1)
75+
76+
echo "Verifying justfile was updated..."
77+
grep -q "example" justfile || (echo "ERROR: justfile not updated correctly" && exit 1)
78+
79+
echo "Verifying Dockerfile.web was updated..."
80+
grep -q "example" config/docker/Dockerfile.web || (echo "ERROR: Dockerfile.web not updated correctly" && exit 1)
81+
82+
echo "All verification checks passed!"
6983
- name: Build docker images
7084
working-directory: ${{ env.BUILD_DIR }}
7185
run: docker compose build web node

scripts/start_new_project

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -e # Exit on any error
4+
35
PROJECT_NAME_SLUG=${1:-} # Use argument $1 or empty as the default
46
BRANCH=${2:-main} # Use argument $2 or main as the default
57
QUIET_INSTALL=${3:-0} # Use argument $3 or 0 as the default
@@ -95,9 +97,9 @@ COMPOSE_DOCKER_CLI_BUILD=1
9597
EOF
9698

9799
just clean_extra_files
98-
sed -i '' "s|image: epicserve/django-base-site|image: ${PROJECT_NAME_SLUG}|" compose.yml
99-
sed -i '' "s|django-base-site|${PROJECT_NAME_SLUG}|" justfile
100-
sed -i '' "s|django-base-site|${PROJECT_NAME_SLUG}|" config/docker/Dockerfile.web
100+
sed -i.bak "s|image: epicserve/django-base-site|image: ${PROJECT_NAME_SLUG}|" compose.yml && rm compose.yml.bak
101+
sed -i.bak "s|django-base-site|${PROJECT_NAME_SLUG}|" justfile && rm justfile.bak
102+
sed -i.bak "s|django-base-site|${PROJECT_NAME_SLUG}|" config/docker/Dockerfile.web && rm config/docker/Dockerfile.web.bak
101103
find ./public -name ".keep" | xargs rm -rf
102104

103105
echo ""

0 commit comments

Comments
 (0)