Skip to content

Commit

Permalink
Fix cleanup bug.
Browse files Browse the repository at this point in the history
Wow, no idea how this one crept in there,
but cleanup scripts have been failing for awhile...
  • Loading branch information
nsheff committed Mar 20, 2019
1 parent 5b668d2 commit e2b08ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1882,11 +1882,11 @@ def _cleanup(self, dry_run=False):
items_to_clean = glob.glob(cleandir)
for clean_item in items_to_clean:
with open(self.cleanup_file, "a") as clean_script:
if os.path.isfile(file):
if os.path.isfile(clean_item):
clean_script.write("rm " + clean_item + "\n")
elif os.path.isdir(file):
elif os.path.isdir(clean_item):
clean_script.write("rmdir " + clean_item + "\n")
except Exception:
except Exception as e:
no_cleanup_script.append(cleandir)
if no_cleanup_script:
print('\n\nCould not produce cleanup script for item(s):\n\n- ' + '\n- '.join(no_cleanup_script))
Expand Down

0 comments on commit e2b08ca

Please sign in to comment.