Skip to content

Commit

Permalink
fix: add pipeline root path check in create command (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand committed Oct 13, 2023
1 parent 9cc7ad3 commit 65977a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deployer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ def create(
"""Create files structure for a new pipeline."""
logger.info(f"Creating pipeline {pipeline_name}")

if not Path(PIPELINE_ROOT_PATH).is_dir():
raise FileNotFoundError(
f"Pipeline root path '{PIPELINE_ROOT_PATH}' does not exist."
" Please check that the pipeline root path is correct"
f" or create it with `mkdir -p {PIPELINE_ROOT_PATH}`."
)

pipeline_filepath = Path(PIPELINE_ROOT_PATH) / f"{pipeline_name}.py"
pipeline_filepath.touch(exist_ok=False)
pipeline_filepath.write_text(PIPELINE_MINIMAL_TEMPLATE.format(pipeline_name=pipeline_name))
Expand Down

0 comments on commit 65977a0

Please sign in to comment.