Skip to content

Commit d94be01

Browse files
committed
Added feedback to user for failed json check
1 parent ad8bb19 commit d94be01

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/helpers/file_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def check_directory(self):
1616
os.mkdir(directory)
1717
print("[!] %s didn't exist and has been created." % directory)
1818

19-
# placeholder for error checking on -oJ implementation
2019
def is_json(json_file):
2120
try:
2221
with open(json_file, "r") as f:

lib/helpers/output_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def output_json(self, filename):
7474
}
7575

7676
output['Result'] = result
77+
78+
if not file.is_json(output):
79+
print("[!] Json format check failed")
80+
7781
file.write_file(json.dumps(output, indent=2))
7882

7983
def output_fuzzy(self):

0 commit comments

Comments
 (0)