Fix prod
This commit is contained in:
parent
98d8b9ef5a
commit
90f6fb7c51
4
main.ts
4
main.ts
|
|
@ -6,14 +6,14 @@ console.log(`Bun Version: ${Bun.version}`)
|
|||
console.log("----------------------------------\n\n")
|
||||
|
||||
const run = async (cmd: string[]) => {
|
||||
const commandText = cmd.join(" ")
|
||||
const proc = spawn(cmd, {
|
||||
const proc = spawn(cmd.filter(Boolean), {
|
||||
stdout: "inherit",
|
||||
stderr: "inherit",
|
||||
})
|
||||
|
||||
const status = await proc.exited
|
||||
|
||||
const commandText = cmd.join(" ")
|
||||
if (status !== 0) {
|
||||
throw new Error(`Process "${commandText}" failed with exit code ${status}`)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ export const buildRoute = async ({ distDir, routeName, filepath, force = false }
|
|||
}
|
||||
}
|
||||
|
||||
// In production I want to limit the number of times we build routes, so I only build it if it doesn't exist or if the cache is not set
|
||||
// The cache is so that when we deploy it will always rebuild the routes.
|
||||
const needsBuild = async (routeName: string, distDir: string) => {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user