fix: Prisma binary download for Iran servers
This commit is contained in:
28
scripts/copy-prisma-generated.ps1
Normal file
28
scripts/copy-prisma-generated.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
# اسکریپت کپی کردن Prisma generated files برای deployment
|
||||
|
||||
Write-Host "Copying Prisma generated files..." -ForegroundColor Cyan
|
||||
|
||||
# ساخت پوشه
|
||||
New-Item -ItemType Directory -Force -Path "prisma/generated" | Out-Null
|
||||
|
||||
# بررسی وجود فایلها
|
||||
if (-not (Test-Path "node_modules/.prisma/client")) {
|
||||
Write-Host "Error: Prisma client not found!" -ForegroundColor Red
|
||||
Write-Host "Please run: npm install && npx prisma generate" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# کپی کردن
|
||||
Write-Host "Copying .prisma/client..." -ForegroundColor Green
|
||||
Copy-Item -Recurse -Force "node_modules/.prisma/client" "prisma/generated/.prisma-client"
|
||||
|
||||
Write-Host "Copying @prisma/client..." -ForegroundColor Green
|
||||
Copy-Item -Recurse -Force "node_modules/@prisma/client" "prisma/generated/@prisma-client"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "✓ Files copied successfully!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Now commit and push:" -ForegroundColor Cyan
|
||||
Write-Host "git add prisma/generated"
|
||||
Write-Host "git commit -m 'Add pre-generated Prisma client'"
|
||||
Write-Host "git push"
|
||||
Reference in New Issue
Block a user