Fix CI: Correctly copy Ent files excluding schema directory
Use find with proper path handling to copy all generated .go files while excluding the schema directory and preserving subdirectory structure.
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -50,9 +50,8 @@ jobs:
|
||||
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
|
||||
echo "Copying Ent code to internal/ent..."
|
||||
mkdir -p ../internal/ent
|
||||
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \;
|
||||
find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
|
||||
rm -f ../internal/ent/generate.go
|
||||
rm -rf ../internal/ent/schema
|
||||
echo "Verifying internal/ent/ent.go exists..."
|
||||
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
|
||||
else
|
||||
@@ -122,9 +121,8 @@ jobs:
|
||||
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
|
||||
echo "Copying Ent code to internal/ent..."
|
||||
mkdir -p ../internal/ent
|
||||
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \;
|
||||
find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
|
||||
rm -f ../internal/ent/generate.go
|
||||
rm -rf ../internal/ent/schema
|
||||
echo "Verifying internal/ent/ent.go exists..."
|
||||
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
|
||||
else
|
||||
@@ -179,9 +177,8 @@ jobs:
|
||||
cd ent && go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
|
||||
echo "Copying Ent code to internal/ent..."
|
||||
mkdir -p ../internal/ent
|
||||
find . -name "*.go" -type f -exec cp --parents {} ../internal/ent/ \;
|
||||
find . -name "*.go" -type f ! -path "./schema/*" -exec sh -c 'mkdir -p ../internal/ent/$(dirname "{}") && cp "{}" ../internal/ent/"{}"' \;
|
||||
rm -f ../internal/ent/generate.go
|
||||
rm -rf ../internal/ent/schema
|
||||
echo "Verifying internal/ent/ent.go exists..."
|
||||
ls -la ../internal/ent/ent.go || echo "ERROR: ent.go not found!"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user