Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions apps/api/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ phases:

- echo "Checking build output..."
- ls -la dist/
- ls -la dist/src/
- '[ -f "dist/src/main.js" ] || { echo "❌ main.js not found in dist/src"; exit 1; }'
- ls -la dist/apps/api/src/ || ls -la dist/src/
- '[ -f "dist/apps/api/src/main.js" ] || [ -f "dist/src/main.js" ] || { echo "❌ main.js not found"; exit 1; }'

- mkdir -p ../docker-build
- cp -r dist/* ../docker-build/
# Handle both output structures (dist/apps/api/src or dist/src)
- |
if [ -d "dist/apps/api/src" ]; then
echo "Using composite output structure..."
cp -r dist/apps/api/* ../docker-build/
else
echo "Using standard output structure..."
cp -r dist/* ../docker-build/
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: File vs directory check mismatch causes wrong copy path

The validation on line 54 checks for file existence using [ -f "dist/apps/api/src/main.js" ] with OR logic, while the copy decision on line 59 checks for directory existence using [ -d "dist/apps/api/src" ]. If the directory exists but is empty or lacks main.js, while dist/src/main.js exists in the standard location, validation passes but the copy selects the wrong source path. The directory check at line 59 needs to match the file-based check logic, such as [ -f "dist/apps/api/src/main.js" ].

Additional Locations (1)

Fix in Cursor Fix in Web

- cp -r prisma ../docker-build/

- echo "Verifying copied files..."
- ls -la ../docker-build/
- ls -la ../docker-build/src/
Expand Down
Loading