Skip to content

Commit

Permalink
fix: clear up saveJsonFile func
Browse files Browse the repository at this point in the history
  • Loading branch information
radekBednarik committed Dec 17, 2023
1 parent 4f59b3c commit fd179d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/io/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export async function readJsonFile(filePath: string): Promise<any> {
export async function saveJsonFile(filePath: string, data: any): Promise<void> {
try {
const fullPath = resolve(filePath);
const _data = JSON.stringify(data, null, 2);

log.trace(`Saving JSON file: ${fullPath} with data: ${JSON.stringify(data)}}`);
log.trace(`Saving JSON file: ${fullPath} with data: ${data}}`);

await writeFile(resolve(filePath), JSON.stringify(data, null, 2), "utf-8");
await writeFile(fullPath, _data, { encoding: "utf-8" });

log.trace(`JSON file saved`);
} catch (error: any) {
Expand Down

0 comments on commit fd179d5

Please sign in to comment.