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

Added working workflow file

This commit is contained in:
Thomas Bui
2021-01-10 20:01:50 -08:00
parent d0d101a776
commit 3d2e655f81
6 changed files with 84 additions and 38 deletions

View File

@@ -230,3 +230,11 @@ def get_added_modified_svgs(files_added_json_path: str,
svgs.append(path)
return svgs
def write_to_file(path: str, value: any):
"""
Write the value to a JSON file.
"""
with open(path, "w") as file:
file.write(value)

View File

@@ -2,6 +2,7 @@ from typing import List
import xml.etree.ElementTree as et
from pathlib import Path
import os
import json
import platform
import sys
import traceback
@@ -24,6 +25,8 @@ def check_svgs(svg_file_paths: List[Path]):
The style must not contain any 'fill' declarations.
If any error is found, they will be thrown.
:param: svg_file_paths, the file paths to the svg to check for.
:return: None if there no errors. If there is, return a JSON.stringified
list with the error messages in it.
"""
# batch err messages together so user can fix everything at once
err_msgs = []
@@ -63,7 +66,8 @@ def check_svgs(svg_file_paths: List[Path]):
err_msgs.append("\n".join(err_msg))
if len(err_msgs) > 0:
raise Exception("Errors found in these files:\n" + "\n\n".join(err_msgs))
return "\n\n".join(err_msgs)
return 'None'
def set_env_var(key: str, value: str, delimiter: str='~'):