Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Dec 24, 2024
1 parent a8a130b commit d5dd3d2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion templates/docker-entrypoint.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const { writeFileSync } = require('node:fs')
<% if (prismaFile) { -%>
const path = require('node:path')
const fs = require('node:fs')
<% } else if (prismaEnv && sqlite3) { -%>
const fs = require('node:fs')
<% } -%>
<% } -%>

Expand Down Expand Up @@ -63,7 +65,7 @@ if (process.env.DATABASE_URL) {
<%= tab(2) %>source = path.resolve('./.output/server', '<%- prismaFile %>')
<%= tab(2) %>if (!fs.existsSync(source) && fs.existsSync('/data')) fs.symlinkSync(target, source)
<% } -%>
<% } else if (prismaSeed && sqlite3) { -%>
<% } else if (prismaSeed && sqlite3 && prismaEnv) { -%>
<%= tab(2) %>const url = new URL(process.env.<%= prismaEnv %>)
<%= tab(2) %>const target = url.protocol === 'file:' && url.pathname
<%= tab(2) %>const newDb = target && !fs.existsSync(target)
Expand Down
1 change: 1 addition & 0 deletions test/base/windows/docker-entrypoint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

const { spawn } = require('node:child_process')
const fs = require('node:fs')

const env = { ...process.env }

Expand Down
3 changes: 0 additions & 3 deletions test/frameworks/remix-epic/docker-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const env = { ...process.env }
;(async() => {
// If running the web server then migrate existing database
if (process.argv.slice(2).join(' ') === 'npm run start' && process.env.FLY_REGION === process.env.PRIMARY_REGION) {
const url = new URL(process.env.)
const target = url.protocol === 'file:' && url.pathname
const newDb = target && !fs.existsSync(target)
await exec('npx prisma migrate deploy')
}

Expand Down
1 change: 1 addition & 0 deletions test/frameworks/remix-indie/docker-entrypoint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

const { spawn } = require('node:child_process')
const fs = require('node:fs')

const env = { ...process.env }

Expand Down

0 comments on commit d5dd3d2

Please sign in to comment.