mirror of
https://github.com/konpa/devicon.git
synced 2025-08-11 17:14:27 +02:00
Added workflow for building the repo
This commit is contained in:
19
.github/scripts/build_assets/PathResolverAction.py
vendored
Normal file
19
.github/scripts/build_assets/PathResolverAction.py
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class PathResolverAction(argparse.Action):
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
path = Path(values).resolve()
|
||||
if not path.exists():
|
||||
raise ValueError(f"{path} doesn't exist.")
|
||||
|
||||
if self.dest == "icons_folder_path":
|
||||
if not path.is_dir():
|
||||
raise ValueError("icons_folder_path must be a directory")
|
||||
|
||||
elif self.dest == "download_path":
|
||||
if not path.is_dir():
|
||||
raise ValueError("download_path must be a directory")
|
||||
|
||||
setattr(namespace, self.dest, str(path))
|
Reference in New Issue
Block a user