Skip to content

Commit

Permalink
fix(clipboard): revert port changes on failed lint/test
Browse files Browse the repository at this point in the history
If the tests fail or the user doesn't want to continue after a failed lint, revert the port contents to the original
  • Loading branch information
harens committed May 21, 2023
1 parent b18aa43 commit a01845f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions seaport/_clipboard/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def clip(
if lint:
# If the lint is not successful
if not perform_lint(name):
if not write:
revert_contents(original, file_location)
# If user doesn't wish to continue after failed lint, contents should revert to original
revert_contents(original, file_location)
sys.exit(1)

if test:
Expand All @@ -157,8 +157,8 @@ def clip(
result = perform_test(name)
# If the tests fail
if not result:
if not write:
revert_contents(original, file_location)
# If tests fail, contents should revert to original working version?
revert_contents(original, file_location)
sys.exit(1)

if install:
Expand Down

0 comments on commit a01845f

Please sign in to comment.