mirror of
https://github.com/konpa/devicon.git
synced 2025-08-01 20:30:18 +02:00
add check for directory /icons when workflow is executed (fixes #505)
This commit is contained in:
6
.github/scripts/build_assets/filehandler.py
vendored
6
.github/scripts/build_assets/filehandler.py
vendored
@@ -213,7 +213,7 @@ def get_added_modified_svgs(files_added_json_path: str,
|
|||||||
Get the svgs added and modified from the files_changed_json_path.
|
Get the svgs added and modified from the files_changed_json_path.
|
||||||
:param: files_added_json_path, the path to the files_added.json created by the gh-action-get-changed-files@2.1.4
|
:param: files_added_json_path, the path to the files_added.json created by the gh-action-get-changed-files@2.1.4
|
||||||
:param: files_modified_json_path, the path to the files_modified.json created by the gh-action-get-changed-files@2.1.4
|
:param: files_modified_json_path, the path to the files_modified.json created by the gh-action-get-changed-files@2.1.4
|
||||||
:return: a list of the svg file paths that were added/modified in this pr as Path.
|
:return: a list of the svg file paths that were added/modified in this pr as Path. It will only return icons in /icons path (see https://github.com/devicons/devicon/issues/505)
|
||||||
"""
|
"""
|
||||||
files_added = get_json_file_content(files_added_json_path)
|
files_added = get_json_file_content(files_added_json_path)
|
||||||
files_modified = get_json_file_content(files_modified_json_path)
|
files_modified = get_json_file_content(files_modified_json_path)
|
||||||
@@ -221,12 +221,12 @@ def get_added_modified_svgs(files_added_json_path: str,
|
|||||||
svgs = []
|
svgs = []
|
||||||
for file in files_added:
|
for file in files_added:
|
||||||
path = Path(file)
|
path = Path(file)
|
||||||
if path.suffix.lower() == ".svg":
|
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
|
||||||
svgs.append(path)
|
svgs.append(path)
|
||||||
|
|
||||||
for file in files_modified:
|
for file in files_modified:
|
||||||
path = Path(file)
|
path = Path(file)
|
||||||
if path.suffix.lower() == ".svg":
|
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
|
||||||
svgs.append(path)
|
svgs.append(path)
|
||||||
|
|
||||||
return svgs
|
return svgs
|
||||||
|
Reference in New Issue
Block a user