File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 55
66import datetime
77import logging
8- import os
98import pathlib
109import sys
1110import typing as t
@@ -65,7 +64,7 @@ def main(
6564 logging .basicConfig (level = "DEBUG" )
6665 if "revision" in model :
6766 del model ["revision" ]
68- model [ "path" ] = _ensure_git (model [ "path" ] )
67+ _ensure_git (model )
6968 old_model = capellambse .MelodyModel (** model , revision = old_version )
7069 new_model = capellambse .MelodyModel (** model , revision = new_version )
7170
@@ -92,18 +91,19 @@ def main(
9291 report_file .write (report .generate_html (result ))
9392
9493
95- def _ensure_git (path : str | os . PathLike ) -> str :
96- proto , path = fh .split_protocol (path )
94+ def _ensure_git (model : dict [ str , t . Any ] ) -> None :
95+ proto , path = fh .split_protocol (model [ " path" ] )
9796 if proto == "file" :
9897 assert isinstance (path , pathlib .Path )
99- path = "git+" + path .resolve ().as_uri ()
100-
101- proto , _ = fh .split_protocol (path )
102- if proto != "git" :
98+ path = path .resolve ()
99+ if "entrypoint" not in model and path .is_file ():
100+ model ["entrypoint" ] = path .name
101+ path = path .parent
102+ model ["path" ] = "git+" + path .as_uri ()
103+ elif proto != "git" :
103104 raise click .Abort ("The 'model' must point to a git repository" )
104105
105- assert isinstance (path , str )
106- return path
106+ assert isinstance (model ["path" ], str )
107107
108108
109109def _get_revision_info (
You can’t perform that action at this time.
0 commit comments