Skip to content

Commit

Permalink
Fix format-patch
Browse files Browse the repository at this point in the history
Clear the patch directory first
Use shutil.move instead to handle different filesystems for temp dir and allwpilib
  • Loading branch information
KangarooKoala committed Jul 16, 2024
1 parent 71b9f07 commit 53e90d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion upstream_utils/upstream_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,16 @@ def format_patch(self, tag=None):
print(
f"WARNING: Patch directory {patch_dest} does not exist", file=sys.stderr
)
else:
shutil.rmtree(patch_dest)

is_first = True
for f in os.listdir():
if f.endswith(".patch"):
os.rename(f, os.path.join(patch_dest, f))
if is_first:
os.mkdir(patch_dest)
is_first = False
shutil.move(f, patch_dest)

self.replace_tag(tag)

Expand Down

0 comments on commit 53e90d0

Please sign in to comment.