Skip to content

Commit

Permalink
Use utils function for checking if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
gounux committed Apr 26, 2024
1 parent 274e435 commit 892cc5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geotribu_cli/content/header_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 892cc5c

Please sign in to comment.