From 9b66f53de6e54983fd73b58c0f2ba3fc566bfa5c Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Mon, 22 Jan 2024 09:55:05 -0500 Subject: [PATCH] fuse: Clone dandi/dandisets if not present at path --- code/src/healthstatus/mounts.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/src/healthstatus/mounts.py b/code/src/healthstatus/mounts.py index fb9e76a8b..7c3637f2d 100644 --- a/code/src/healthstatus/mounts.py +++ b/code/src/healthstatus/mounts.py @@ -59,7 +59,18 @@ def name(self) -> str: @contextmanager def mount(self) -> Iterator[None]: - if self.update: + if not self.dataset_path.exists(): + log.info("Cloning dandi/dandisets to %s ...", self.dataset_path) + subprocess.run( + [ + "datalad", + "clone", + "git@github.com:dandi/dandisets.git", + os.fspath(self.dataset_path), + ], + check=True, + ) + elif self.update: log.info("Updating Dandisets dataset at %s ...", self.dataset_path) subprocess.run( [