Handle no read perms on checksum file

This commit is contained in:
ItsDrike 2021-05-17 16:07:03 +02:00
parent cc85ab1e78
commit 1c9cc30ff3
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -75,6 +75,12 @@ def _get_checksum_dict(file):
with open(file, 'w') as f: with open(file, 'w') as f:
json.dump(checksums, f) json.dump(checksums, f)
return checksums return checksums
except PermissionError:
print(
f'{colorama.Fore.RED}PermissionError: {colorama.Fore.RESET}'
'to run tamper-check you must have read access to checksum file: '
f"'{colorama.Fore.BLUE}{file}{colorama.Fore.RESET}' (forgot sudo?)"
)