Skip to content

Commit

Permalink
Merge pull request #7 from radekBednarik/dev
Browse files Browse the repository at this point in the history
dev: minor fixes and adjustments
  • Loading branch information
radekBednarik authored Dec 17, 2023
2 parents 4f59b3c + 7ff2e27 commit f902b6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bednarik_radek/mockserver-cli",
"version": "0.2.0",
"version": "0.2.1",
"description": "CLI utility for Mock-server client. Allows for easy creation/deletion of expectations on the Mock-server instance.",
"main": "index.js",
"type": "module",
Expand Down
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 f902b6c

Please sign in to comment.