From e250df05de568a8120cd364731baf4a06051548d Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 17 May 2021 16:13:38 +0200 Subject: [PATCH] Use indent of 4 to ensure json file readability --- root/usr/local/bin/tamper-check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/usr/local/bin/tamper-check b/root/usr/local/bin/tamper-check index 916ac3a..7b26cc3 100755 --- a/root/usr/local/bin/tamper-check +++ b/root/usr/local/bin/tamper-check @@ -73,7 +73,7 @@ def _get_checksum_dict(file): os.makedirs(os.path.dirname(file), exist_ok=True) checksums = {} with open(file, 'w') as f: - json.dump(checksums, f) + json.dump(checksums, f, indent=4) return checksums except PermissionError: print( @@ -99,7 +99,7 @@ def _add_file(file_path, checksum, checksum_file, update_only=False): checksums[file_path] = checksum try: with open(checksum_file, 'w') as f: - json.dump(checksums, f) + json.dump(checksums, f, indent=4) except PermissionError: print( f'{colorama.Fore.RED}PermissionError: {colorama.Fore.RESET}'