1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-23 06:33:11 +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

@@ -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)