Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
chore: scripts: apply_patches: add help string
Browse files Browse the repository at this point in the history
Signed-off-by: Ookiineko <[email protected]>
  • Loading branch information
Ookiineko committed Dec 12, 2023
1 parent 7d2bebb commit 496ddd9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/apply_patches.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env python3
"""
a cursed script doesn't use argparse
"""
import os
import os.path
import sys


files = []
list(map(lambda x: files.extend(x.split()) if x else None, sys.argv[1:]))
list(map(lambda x: files.extend(x.strip().split()) if x else None, sys.argv[1:]))

if not files:
print(f'Usage: {sys.argv[0]} <patch file 0> [patch file 1] ... [patch file N]')

top = os.getcwd()

Expand All @@ -23,4 +29,5 @@
os.chdir(os.path.join('vendor', vndproj))
assert not os.system(f'patch -p1 -i {pfile!r} --no-backup-if-mismatch -f'), f'failed to apply {pfile!r}'

print('Done!')
if files:
print('Done!')

0 comments on commit 496ddd9

Please sign in to comment.