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