From eb33f10478e2fc27c3821e589793b80de3a1617b Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Mon, 12 May 2025 01:33:40 +0530 Subject: [PATCH] fix: ensure tmp.json is created before formatting package.json --- scripts/format-package-json.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/format-package-json.js b/scripts/format-package-json.js index 6e90c03..4a8d4a5 100755 --- a/scripts/format-package-json.js +++ b/scripts/format-package-json.js @@ -1,6 +1,9 @@ import { exec } from "child_process"; +import { writeFileSync } from "fs"; export function preCommit({ tag, version }) { + writeFileSync("tmp.json", "{}") + exec("jq --indent 4 . package.json > tmp.json && mv tmp.json package.json", (error, stdout, stderr) => { if (error) { console.error(`exec error: ${error}`);