Skip to content

Commit 0b7c7dd

Browse files
committed
create missing dirs when symlinking files
1 parent 4d52939 commit 0b7c7dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bma_client_lib/bma_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def upload_file(self, path: Path, attribution: str, file_license: str) -> dict[s
378378
# create symlink to file in workdir
379379
workpath = self.path / r.json()["bma_response"]["links"]["downloads"]["original"][1:]
380380
if not workpath.exists():
381+
workpath.parent.mkdir(exist_ok=True)
381382
workpath.symlink_to(path)
382383

383384
return r.json() # type: ignore[no-any-return]

0 commit comments

Comments
 (0)