Skip to content

Commit

Permalink
vtd: Add linking of external models to runtime directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tobifalk committed Mar 12, 2021
1 parent 69aa806 commit 45587b5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/vtd/bin/vtd
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ def teardown_runtime(runtime_dir: Path) -> None:
type=click.Path(exists=True, file_okay=True, dir_okay=True),
help="VTD project to use, default to currently symlinked.",
)
@click.option(
"-m",
"--vtd-external-models",
envvar="VTD_EXTERNAL_MODELS",
multiple=True,
type=click.Path(file_okay=True, dir_okay=False),
default = [],
required=False,
help="VTD external models (env: $VTD_EXTERNAL_MODELS).",
)
@click.option(
"-n",
"--no-start",
Expand All @@ -178,6 +188,7 @@ def start(
skip_setup: bool,
vtd_setup: str,
vtd_project: str,
vtd_external_models : List[str],
no_start: bool,
vtd_args: str,
):
Expand Down Expand Up @@ -220,6 +231,14 @@ def start(
os.remove(dst)
os.symlink(vtd_project, dst)

for srcfile in vtd_external_models:
srcfile = Path(srcfile)
dstdir = opt.runtime_dir / "Data" / "Setups" / "Current" / "Bin"
dstfile = dstdir / srcfile.name
if not dstfile.is_file():
logging.debug("Create symlink: {} -> {}".format(dstfile, srcfile))
os.symlink(srcfile, dstfile)

if no_start:
return

Expand Down

0 comments on commit 45587b5

Please sign in to comment.