1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-12 01:24:42 +02:00

Various bug fixes and reference update

This commit is contained in:
Thomas Bui
2020-12-29 15:11:28 -08:00
parent eb6884db84
commit 8a5ff05f01
8 changed files with 61 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
from argparse import ArgumentParser
from build_assets.PathResolverAction import PathResolverAction
def get_commandline_args(peek_mode=False):
def get_selenium_runner_args(peek_mode=False):
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
parser.add_argument("--headless",
@@ -33,3 +33,12 @@ def get_commandline_args(peek_mode=False):
help="The title of the PR that we are peeking at")
return parser.parse_args()
def get_generate_markdown_args():
parser = ArgumentParser(description="Generate markdown for the image urls passed in.")
parser.add_argument("img_urls",
help="The urls of the images. Must be the string/JSON form of an array. Ex: '[1,2,3]'")
return parser.parse_args()

View File

@@ -147,7 +147,7 @@ def rename_extracted_files(extract_path: str):
print("Files renamed")
def create_screenshot_folder(dir, screenshot_name: str="screenshots"):
def create_screenshot_folder(dir, screenshot_name: str="screenshots/"):
"""
Create a screenshots folder in the dir.
:param dir, the dir where we want to create the folder.
@@ -158,5 +158,11 @@ def create_screenshot_folder(dir, screenshot_name: str="screenshots"):
folder = Path(dir).resolve()
if not folder.is_dir():
raise Exception(f"This is not a dir: {str(folder)}. \ndir must be a valid directory")
folder.mkdir(screenshot_name, exist_ok=True)
return str(folder)
screenshot_folder = Path(folder, screenshot_name)
try:
os.mkdir(screenshot_folder)
except FileExistsError:
print(f"{screenshot_folder} already exist. Script will do nothing.")
finally:
return str(screenshot_folder)