mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
do check for .git/hooks/pre-commit in a slightly more elegant way
This commit is contained in:
parent
fda8f4e5c1
commit
0f86dbaf97
1 changed files with 9 additions and 6 deletions
11
server.js
11
server.js
|
@ -86,12 +86,15 @@ fastify.listen({
|
||||||
});
|
});
|
||||||
console.log(`Listening on port ${PORT}`);
|
console.log(`Listening on port ${PORT}`);
|
||||||
|
|
||||||
mkdirSync(".git/hooks", { recursive: true });
|
try {
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
".git/hooks/pre-commit",
|
".git/hooks/pre-commit",
|
||||||
"pnpm prettier . -w\ngit update-index --again"
|
"pnpm prettier . -w\ngit update-index --again"
|
||||||
);
|
);
|
||||||
chmodSync(".git/hooks/pre-commit", 0o755);
|
chmodSync(".git/hooks/pre-commit", 0o755);
|
||||||
|
} catch {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const watch = spawn("pnpm", ["rspack", "-w"], {
|
const watch = spawn("pnpm", ["rspack", "-w"], {
|
||||||
detached: true,
|
detached: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue