fix: ensure tmp.json is created before formatting package.json
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user