Skip to content

Commit

Permalink
package as zip
Browse files Browse the repository at this point in the history
  • Loading branch information
oshmuely authored and oshmuely committed Apr 7, 2023
1 parent 70198a2 commit 7353281
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packaging/files_name_mapping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/python3
import datetime
import re
import shutil
import os
from zipfile import ZipFile

SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))

Expand All @@ -19,6 +21,7 @@


def main():
update_frk_list = []
frk_list = os.listdir(raw_dir)

for from_name in frk_list:
Expand Down Expand Up @@ -48,8 +51,19 @@ def main():
print(to_name)
shutil.copy2(f'{raw_dir}/{from_name}', f'{to_dir}/{to_name}')

update_frk_list.append(to_name)
print(to_name)
pass

date = datetime.date.today()
year_month = date.strftime('%Y-%m-%d')

print('zipping...')
with ZipFile(f'{SCRIPT_DIR}/../uni-firmware-{year_month}.zip', 'w') as myzip:
for to_name in update_frk_list:
myzip.write(f'{SCRIPT_DIR}/../{to_name}', to_name)

pass


main()

0 comments on commit 7353281

Please sign in to comment.