Skip to content

Commit

Permalink
[nrf toup][nrfconnect] Fix zap-generate -o path argument
Browse files Browse the repository at this point in the history
Fix `-o` path argument to be absolute, or relative to current path.
Check if `-o` path argument is an existing directory.

Signed-off-by: Maciej Baczmanski <[email protected]>
  • Loading branch information
maciejbaczmanski authored and kkasperczyk-no committed Jul 15, 2024
1 parent 99d4333 commit c0df90b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/west/zap_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import sys

from pathlib import Path
from textwrap import dedent

from west import log
Expand All @@ -33,7 +32,7 @@ def do_add_parser(self, parser_adder):
description=self.description)
parser.add_argument('-z', '--zap-file', type=existing_file_path,
help='Path to data model configuration file (*.zap)')
parser.add_argument('-o', '--output', type=Path,
parser.add_argument('-o', '--output', type=existing_dir_path,
help='Path where to store the generated files')
parser.add_argument('-m', '--matter-path', type=existing_dir_path,
default=DEFAULT_MATTER_PATH, help='Path to Matter SDK')
Expand All @@ -49,7 +48,7 @@ def do_run(self, args, unknown_args):
raise CommandError("No valid .zap file provided")

if args.output:
output_path = args.output
output_path = args.output.absolute()
else:
output_path = zap_file_path.parent / "zap-generated"

Expand Down

0 comments on commit c0df90b

Please sign in to comment.