mirror of
https://github.com/konpa/devicon.git
synced 2025-08-15 19:14:05 +02:00
Add try-except in icomoon_upload. Workflow will also upload geckodriver.log as an artifact for debugging purpose
This commit is contained in:
1
.github/scripts/build_assets/filehandler.py
vendored
1
.github/scripts/build_assets/filehandler.py
vendored
@@ -59,6 +59,7 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]:
|
||||
if not folder_path.is_dir():
|
||||
raise ValueError(f"Invalid path. This is not a directory: {folder_path}.")
|
||||
|
||||
# TODO: remove the try-except when the devicon.json is upgraded
|
||||
try:
|
||||
aliases = icon_info["aliases"]
|
||||
except KeyError:
|
||||
|
30
.github/scripts/icomoon_upload.py
vendored
30
.github/scripts/icomoon_upload.py
vendored
@@ -1,5 +1,6 @@
|
||||
from pathlib import Path
|
||||
from argparse import ArgumentParser
|
||||
from selenium.common.exceptions import TimeoutException
|
||||
|
||||
# pycharm complains that build_assets is an unresolved ref
|
||||
# don't worry about it, the script still runs
|
||||
@@ -42,20 +43,25 @@ def main():
|
||||
print("No files need to be uploaded. Ending script...")
|
||||
return
|
||||
|
||||
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
|
||||
args.geckodriver_path, args.headless)
|
||||
runner.upload_icomoon()
|
||||
svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path)
|
||||
runner.upload_svgs(svgs)
|
||||
try:
|
||||
runner = SeleniumRunner(args.icomoon_json_path, args.download_path,
|
||||
args.geckodriver_path, args.headless)
|
||||
runner.upload_icomoon()
|
||||
svgs = filehandler.get_svgs_paths(new_icons, args.icons_folder_path)
|
||||
runner.upload_svgs(svgs)
|
||||
|
||||
|
||||
zip_name = "devicon-v1.0.zip"
|
||||
zip_path = Path(args.download_path, zip_name)
|
||||
runner.download_icomoon_fonts(zip_path)
|
||||
filehandler.extract_files(str(zip_path), args.download_path)
|
||||
filehandler.rename_extracted_files(args.download_path)
|
||||
runner.close()
|
||||
print("Task completed.")
|
||||
zip_name = "devicon-v1.0.zip"
|
||||
zip_path = Path(args.download_path, zip_name)
|
||||
runner.download_icomoon_fonts(zip_path)
|
||||
filehandler.extract_files(str(zip_path), args.download_path)
|
||||
filehandler.rename_extracted_files(args.download_path)
|
||||
runner.close()
|
||||
print("Task completed.")
|
||||
except TimeoutException as e:
|
||||
print(e)
|
||||
print(e.stacktrace)
|
||||
runner.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
2
.github/scripts/requirements.txt
vendored
2
.github/scripts/requirements.txt
vendored
@@ -1 +1 @@
|
||||
selenium
|
||||
selenium==3.141.0
|
Reference in New Issue
Block a user