mirror of
https://github.com/konpa/devicon.git
synced 2025-08-14 18:44:17 +02:00
Changed return to sys.exit in python script to show error
This commit is contained in:
9
.github/scripts/icomoon_build.py
vendored
9
.github/scripts/icomoon_build.py
vendored
@@ -1,4 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
from selenium.common.exceptions import TimeoutException
|
from selenium.common.exceptions import TimeoutException
|
||||||
|
|
||||||
# pycharm complains that build_assets is an unresolved ref
|
# pycharm complains that build_assets is an unresolved ref
|
||||||
@@ -11,8 +12,7 @@ def main():
|
|||||||
args = arg_getters.get_selenium_runner_args()
|
args = arg_getters.get_selenium_runner_args()
|
||||||
new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path)
|
new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path)
|
||||||
if len(new_icons) == 0:
|
if len(new_icons) == 0:
|
||||||
print("No files need to be uploaded. Ending script...")
|
sys.exit("No files need to be uploaded. Ending script...")
|
||||||
return
|
|
||||||
|
|
||||||
# print list of new icons
|
# print list of new icons
|
||||||
print("List of new icons:", *new_icons, sep = "\n")
|
print("List of new icons:", *new_icons, sep = "\n")
|
||||||
@@ -32,8 +32,9 @@ def main():
|
|||||||
filehandler.rename_extracted_files(args.download_path)
|
filehandler.rename_extracted_files(args.download_path)
|
||||||
print("Task completed.")
|
print("Task completed.")
|
||||||
except TimeoutException as e:
|
except TimeoutException as e:
|
||||||
print(e)
|
sys.exit("Selenium Time Out Error: \n" + e)
|
||||||
print(e.stacktrace)
|
except Exception as e:
|
||||||
|
sys.exit(e)
|
||||||
finally:
|
finally:
|
||||||
runner.close()
|
runner.close()
|
||||||
|
|
||||||
|
4
.github/scripts/icomoon_peek.py
vendored
4
.github/scripts/icomoon_peek.py
vendored
@@ -38,9 +38,9 @@ def main():
|
|||||||
runner.upload_svgs(svgs, screenshot_folder)
|
runner.upload_svgs(svgs, screenshot_folder)
|
||||||
print("Task completed.")
|
print("Task completed.")
|
||||||
except TimeoutException as e:
|
except TimeoutException as e:
|
||||||
print("Selenium Time Out Error: ", e.stacktrace, sep='\n')
|
sys.exit("Selenium Time Out Error: \n" + e)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
sys.exit(e)
|
||||||
finally:
|
finally:
|
||||||
runner.close()
|
runner.close()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user