fix: added relevant error message if file is missing

This commit is contained in:
Thibaut Giroud 2022-03-29 16:48:14 +02:00
parent 8c545b27af
commit e4788b98ca

View file

@ -98,8 +98,12 @@ def main(store_path, grouping_base, outfile, gpgbinary, use_agent, encodings,
gpg = gnupg.GPG(gpgbinary=gpgbinary, use_agent=use_agent) gpg = gnupg.GPG(gpgbinary=gpgbinary, use_agent=use_agent)
files = path.glob('**/*.gpg') files = path.glob('**/*.gpg')
if not path.is_dir(): if not path.is_dir():
#if store_path[-4:] == '.gpg': if path.is_file():
files = [path] files = [path]
else:
err="No shuch file or directory: {}".format(path)
logging.error(err)
exit(1)
for file in files: for file in files:
logging.info("Processing %s", file) logging.info("Processing %s", file)
with open(file, 'rb') as fp: with open(file, 'rb') as fp: