Skip to content

Commit

Permalink
reverting back to previous save with clear message to the user
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Apr 5, 2020
1 parent e0ebe98 commit cec4424
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions urlchecker/client/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,18 @@ def main(args, extra):
logger.info("Cleaning up %s..." % path)
delete_repo(path)

# force pass
if args.force_pass:
if check_results['failed']:
print("\n\nDone. The following urls did not pass:")
for failed_url in check_results['failed']:
print_failure(failed_url)
sys.exit(1)

else:
print("\n\nDone. All URLS passed.")
sys.exit(1)

# no force pass
# Case 1: We didn't find any urls to check
if not check_results['failed'] and not check_results['passed']:
print("\n\nDone. No urls were collected.")
sys.exit(0)

# Case 2: We had errors, but force pass is True
elif args.force_pass and check_results['failed']:
print("\n\nDone. The following urls did not pass:")
for failed_url in check_results['failed']:
print_failure(failed_url)
sys.exit(1)

else:
# Case 1: We didn't find any urls to check
if not check_results['failed'] and not check_results['passed']:
print("\n\nDone. No urls were collected.")
sys.exit(0)

# Case 2 : Only working urls found
elif not check_results['failed'] and check_results['passed']:
print("\n\nDone. All URLS passed.")
sys.exit(0)

# exit
else:
print("\n\nDone.")
sys.exit(0)
print("\n\nDone. All URLS passed.")
sys.exit(0)

0 comments on commit cec4424

Please sign in to comment.