From 892cc5c6ed2f742655a985055da8e466e28011e5 Mon Sep 17 00:00:00 2001 From: gounux Date: Fri, 26 Apr 2024 10:51:46 +0200 Subject: [PATCH] Use utils function for checking if file exists --- geotribu_cli/content/header_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geotribu_cli/content/header_check.py b/geotribu_cli/content/header_check.py index fbf3d41..539b02f 100644 --- a/geotribu_cli/content/header_check.py +++ b/geotribu_cli/content/header_check.py @@ -11,6 +11,7 @@ from geotribu_cli.__about__ import __executable_name__, __version__ from geotribu_cli.constants import GeotribuDefaults from geotribu_cli.content.json_feed import JsonFeedClient +from geotribu_cli.utils.check_path import check_path_exists logger = logging.getLogger(__name__) defaults_settings = GeotribuDefaults() @@ -141,8 +142,7 @@ def run(args: argparse.Namespace) -> None: logger.debug(f"Running {args.command} with {args}") content_path = args.content_path - if not os.path.exists(content_path): - raise ValueError(f"Mayday ! Le fichier {content_path} n'existe pas !") + check_path_exists(content_path, raise_error=True) with open(content_path) as file: content = file.read()