Skip to content

Commit 45587b5

Browse files
committed
vtd: Add linking of external models to runtime directory
1 parent 69aa806 commit 45587b5

File tree

1 file changed

+19
-0
lines changed
  • plugins/vtd/bin

1 file changed

+19
-0
lines changed

plugins/vtd/bin/vtd

+19
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ def teardown_runtime(runtime_dir: Path) -> None:
159159
type=click.Path(exists=True, file_okay=True, dir_okay=True),
160160
help="VTD project to use, default to currently symlinked.",
161161
)
162+
@click.option(
163+
"-m",
164+
"--vtd-external-models",
165+
envvar="VTD_EXTERNAL_MODELS",
166+
multiple=True,
167+
type=click.Path(file_okay=True, dir_okay=False),
168+
default = [],
169+
required=False,
170+
help="VTD external models (env: $VTD_EXTERNAL_MODELS).",
171+
)
162172
@click.option(
163173
"-n",
164174
"--no-start",
@@ -178,6 +188,7 @@ def start(
178188
skip_setup: bool,
179189
vtd_setup: str,
180190
vtd_project: str,
191+
vtd_external_models : List[str],
181192
no_start: bool,
182193
vtd_args: str,
183194
):
@@ -220,6 +231,14 @@ def start(
220231
os.remove(dst)
221232
os.symlink(vtd_project, dst)
222233

234+
for srcfile in vtd_external_models:
235+
srcfile = Path(srcfile)
236+
dstdir = opt.runtime_dir / "Data" / "Setups" / "Current" / "Bin"
237+
dstfile = dstdir / srcfile.name
238+
if not dstfile.is_file():
239+
logging.debug("Create symlink: {} -> {}".format(dstfile, srcfile))
240+
os.symlink(srcfile, dstfile)
241+
223242
if no_start:
224243
return
225244

0 commit comments

Comments
 (0)