Skip to content
Commits on Source (2)
......@@ -4,6 +4,7 @@
"""Utility functions to retrieve BIDS dataset content to be indexed by the Elasticsearch engine of the HIP."""
import os
import shutil
import json
import subprocess
from concurrent.futures import ProcessPoolExecutor
......@@ -324,6 +325,10 @@ def dataset_publish(input_data, output_file):
# Extract the source and target dataset paths
source_dataset_path = input_content["sourceDatasetPath"]
target_dataset_path = input_content["targetDatasetPath"]
# Remove target sibling if it does exist
if os.path.isdir(target_dataset_path):
print(f"WARNING: Remove existing target sibling dataset ({target_dataset_path})")
shutil.rmtree(target_dataset_path)
# Create datalad dataset sibling to publish to
datalad.api.create_sibling(
name="public",
......
......@@ -6,7 +6,7 @@
import datetime
__version__ = "1.3.0-dev.2"
__version__ = "1.3.0-dev.3"
__current_year__ = datetime.datetime.now().strftime("%Y")
......
# [1.3.0-dev.3](https://gitlab.hbp.link/hip/datahipy/compare/v1.3.0-dev.2...v1.3.0-dev.3) (2023-10-31)
### Bug Fixes
* **bids/dataset.py:** remove target sibling if it exists during create_sibling ([385f72b](https://gitlab.hbp.link/hip/datahipy/commit/385f72bb28249dbab57e39062e697d30fe1cd8a2))
# [1.3.0-dev.2](https://gitlab.hbp.link/hip/datahipy/compare/v1.3.0-dev.1...v1.3.0-dev.2) (2023-10-31)
......