From 89724ca755c6450d40566c051cd077aee4681d97 Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Mon, 12 May 2025 01:38:18 +0530 Subject: [PATCH] refactor: simplify preCommit --- scripts/format-package-json.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/scripts/format-package-json.js b/scripts/format-package-json.js index e0ee5e6..733b44d 100755 --- a/scripts/format-package-json.js +++ b/scripts/format-package-json.js @@ -7,25 +7,11 @@ export function preCommit({ tag, version }) { return; } - // Parse the JSON string into an object - const json = JSON.parse(data); + console.log({ tag, version }); - // Convert the object back to a JSON string + const json = JSON.parse(data); const jsonString = JSON.stringify(json, null, 4); - // Write the updated JSON string back to the file writeFileSync("package.json", jsonString); }); - - // exec("jq --indent 4 . package.json > tmp.json && mv tmp.json package.json", (error, stdout, stderr) => { - // if (error) { - // console.error(`exec error: ${error}`); - // return; - // } - // if (stderr) { - // console.error(`stderr: ${stderr}`); - // return; - // } - // console.log(`stdout: ${stdout}`); - // }); }