fix: cd to lib dir in wrapper so drizzle migrations can find _journal.json

process.cwd() defaults to / (systemd default) without an
explicit WorkingDirectory. The migration code looks for
drizzle/migrations/meta/_journal.json relative to cwd,
so the wrapper must cd into the package directory first.
This commit is contained in:
Developer
2026-07-30 20:24:12 +07:00
parent 05eb490214
commit 9957321423
+4 -2
View File
@@ -84,7 +84,8 @@
mkdir -p $out/bin mkdir -p $out/bin
cat > $out/bin/gmw-backend << WRAPPER cat > $out/bin/gmw-backend << WRAPPER
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
exec ${nodejs}/bin/node $out/lib/gmw-backend/dist/index.js cd $out/lib/gmw-backend
exec ${nodejs}/bin/node dist/index.js
WRAPPER WRAPPER
chmod +x $out/bin/gmw-backend chmod +x $out/bin/gmw-backend
''; '';
@@ -152,7 +153,8 @@ WRAPPER
mkdir -p $out/bin mkdir -p $out/bin
cat > $out/bin/gmw-discord-gateway << WRAPPER cat > $out/bin/gmw-discord-gateway << WRAPPER
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
exec ${nodejs}/bin/node $out/lib/gmw-discord-gateway/dist/index.js cd $out/lib/gmw-discord-gateway
exec ${nodejs}/bin/node dist/index.js
WRAPPER WRAPPER
chmod +x $out/bin/gmw-discord-gateway chmod +x $out/bin/gmw-discord-gateway
''; '';