Skip to content

Commit

Permalink
fuse: Clone dandi/dandisets if not present at path
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jan 22, 2024
1 parent f12a176 commit 9b66f53
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/src/healthstatus/mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,18 @@ def name(self) -> str:

@contextmanager
def mount(self) -> Iterator[None]:
if self.update:
if not self.dataset_path.exists():

Check warning on line 62 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L62

Added line #L62 was not covered by tests
log.info("Cloning dandi/dandisets to %s ...", self.dataset_path)
subprocess.run(

Check warning on line 64 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L64

Added line #L64 was not covered by tests
[
"datalad",
"clone",
"git@github.com:dandi/dandisets.git",
os.fspath(self.dataset_path),
],
check=True,
)
elif self.update:

Check warning on line 73 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L73

Added line #L73 was not covered by tests
log.info("Updating Dandisets dataset at %s ...", self.dataset_path)
subprocess.run(

Check warning on line 75 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L75

Added line #L75 was not covered by tests
[
Expand Down

0 comments on commit 9b66f53

Please sign in to comment.