From 9e87c42d0cabc241ee13b3769ca75ce3d7a1259f Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Sun, 27 Jul 2025 13:07:00 +1000 Subject: [PATCH] add shebangs to migration and server scripts In NixOS, we wrap these files in a bash script to allow users to just run them as normal executables, instead of calling them as arguments to Node.JS. In our build scripts, we just add the shebang after the files have been compiled, but adding it upstream will allow all Pangolin users to just run ./server.mjs to start their Pangolin instances. Signed-off-by: Fernando Rodrigues --- server/index.ts | 1 + server/setup/migrationsPg.ts | 1 + server/setup/migrationsSqlite.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/server/index.ts b/server/index.ts index 55b34543..d3f90281 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1,3 +1,4 @@ +#! /usr/bin/env node import "./extendZod.ts"; import { runSetupFunctions } from "./setup"; diff --git a/server/setup/migrationsPg.ts b/server/setup/migrationsPg.ts index d5e2f46d..6996999c 100644 --- a/server/setup/migrationsPg.ts +++ b/server/setup/migrationsPg.ts @@ -1,3 +1,4 @@ +#! /usr/bin/env node import { migrate } from "drizzle-orm/node-postgres/migrator"; import { db } from "../db/pg"; import semver from "semver"; diff --git a/server/setup/migrationsSqlite.ts b/server/setup/migrationsSqlite.ts index 68da0a27..9fd5a470 100644 --- a/server/setup/migrationsSqlite.ts +++ b/server/setup/migrationsSqlite.ts @@ -1,3 +1,4 @@ +#! /usr/bin/env node import { migrate } from "drizzle-orm/better-sqlite3/migrator"; import { db, exists } from "../db/sqlite"; import path from "path";