mirror of
https://github.com/konpa/devicon.git
synced 2025-08-09 08:06:32 +02:00
download_path commandline arg doesn't have to exist for script to function
This commit is contained in:
@@ -5,6 +5,7 @@ from pathlib import Path
|
|||||||
class PathResolverAction(argparse.Action):
|
class PathResolverAction(argparse.Action):
|
||||||
def __call__(self, parser, namespace, values, option_string=None):
|
def __call__(self, parser, namespace, values, option_string=None):
|
||||||
path = Path(values).resolve()
|
path = Path(values).resolve()
|
||||||
|
if not self.dest == "download_path":
|
||||||
if not path.exists():
|
if not path.exists():
|
||||||
raise ValueError(f"{path} doesn't exist.")
|
raise ValueError(f"{path} doesn't exist.")
|
||||||
|
|
||||||
@@ -12,8 +13,4 @@ class PathResolverAction(argparse.Action):
|
|||||||
if not path.is_dir():
|
if not path.is_dir():
|
||||||
raise ValueError("icons_folder_path must be a directory")
|
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))
|
setattr(namespace, self.dest, str(path))
|
||||||
|
Reference in New Issue
Block a user