This repository has been archived on 2026-07-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
aniwatch-api/scripts/format-package-json.js
2025-05-12 01:38:18 +05:30

18 lines
451 B
JavaScript
Executable File

import { readFile, writeFileSync } from "fs";
export function preCommit({ tag, version }) {
readFile("package.json", "utf8", (err, data) => {
if (err) {
console.error("Error reading file:", err);
return;
}
console.log({ tag, version });
const json = JSON.parse(data);
const jsonString = JSON.stringify(json, null, 4);
writeFileSync("package.json", jsonString);
});
}