3 Commits

Author SHA1 Message Date
572f43010e better error handling when cleaning old runs 2020-12-17 13:04:44 +01:00
3846e8f303 bump version 2020-12-17 12:17:00 +01:00
07ccb09910 make sure name is not a list... 2020-12-17 12:15:20 +01:00
2 changed files with 10 additions and 4 deletions

View File

@ -79,7 +79,7 @@ def parse_args():
args = parser.parse_args()
if not args.name:
args.name = [os.path.basename(args.command[0])]
args.name = os.path.basename(args.command[0])
return args
@ -159,7 +159,10 @@ def print_runs(runs, clean=True):
print("\n\n")
if clean:
for run in runs:
shutil.rmtree(run)
try:
shutil.rmtree(run)
except FileNotFoundError:
pass
def main():
time_format = '%Y-%m-%d_%H%M'
@ -215,7 +218,10 @@ def main():
if previous_runs:
print("Success after {} failed runs\n".format(len(previous_runs)))
print_runs(previous_runs.keys())
shutil.rmtree(libdir)
try:
shutil.rmtree(libdir)
except FileNotFoundError:
pass
return 0

View File

@ -5,7 +5,7 @@ with open('README.md', 'r') as fh:
setuptools.setup(
name='cronwrapper',
version='0.1.1',
version='0.1.3',
author='Fredrik Eriksson',
author_email='feffe@fulh.ax',
description='A small wrapper to handle cronjob failures',