From 90f6fb7c514b060509c6b03fe5c9c83b7ef4e2e8 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 11 Jul 2025 16:17:43 -0700 Subject: [PATCH] Fix prod --- main.ts | 4 ++-- packages/nano-remix/src/buildRoute.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index 21bcd56..1cceeaf 100644 --- a/main.ts +++ b/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 { diff --git a/packages/nano-remix/src/buildRoute.ts b/packages/nano-remix/src/buildRoute.ts index d45eedb..717c7c1 100644 --- a/packages/nano-remix/src/buildRoute.ts +++ b/packages/nano-remix/src/buildRoute.ts @@ -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