From 18f85c7860d6776751c6cb4ca4900a301a554cbb Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Sat, 12 Oct 2024 03:06:00 -0500 Subject: [PATCH] .git/hooks/ doesn't exist when it's a submodule, which would crash the server. --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 9c18f9c..d58a186 100644 --- a/server.js +++ b/server.js @@ -13,7 +13,7 @@ import { baremuxPath } from "@mercuryworkshop/bare-mux/node"; import { epoxyPath } from "@mercuryworkshop/epoxy-transport"; import { libcurlPath } from "@mercuryworkshop/libcurl-transport"; import { bareModulePath } from "@mercuryworkshop/bare-as-module3"; -import { chmodSync, writeFileSync } from "fs"; +import { chmodSync, mkdirSync, writeFileSync } from "fs"; const bare = createBareServer("/bare/", { logErrors: true, @@ -86,6 +86,7 @@ fastify.listen({ }); console.log(`Listening on port ${PORT}`); +mkdirSync(".git/hooks", { recursive: true }); writeFileSync( ".git/hooks/pre-commit", "pnpm prettier . -w\ngit update-index --again"