mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -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
15
server.js
15
server.js
|
@ -86,12 +86,15 @@ 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"
|
||||
);
|
||||
chmodSync(".git/hooks/pre-commit", 0o755);
|
||||
try {
|
||||
writeFileSync(
|
||||
".git/hooks/pre-commit",
|
||||
"pnpm prettier . -w\ngit update-index --again"
|
||||
);
|
||||
chmodSync(".git/hooks/pre-commit", 0o755);
|
||||
} catch {
|
||||
|
||||
}
|
||||
|
||||
const watch = spawn("pnpm", ["rspack", "-w"], {
|
||||
detached: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue