Skip to content

Commit c0df90b

Browse files
maciejbaczmanskikkasperczyk-no
authored andcommitted
[nrf toup][nrfconnect] Fix zap-generate -o path argument
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 <maciej.baczmanski@nordicsemi.no>
1 parent 99d4333 commit c0df90b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/west/zap_generate.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
import sys
88

9-
from pathlib import Path
109
from textwrap import dedent
1110

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

5150
if args.output:
52-
output_path = args.output
51+
output_path = args.output.absolute()
5352
else:
5453
output_path = zap_file_path.parent / "zap-generated"
5554

0 commit comments

Comments
 (0)