corrected creation of ci-env.yml and more use of pathlib

This commit is contained in:
Milton Camacho 2024-01-31 20:58:41 +00:00
parent c336879fa5
commit 483cc64d53
1 changed files with 4 additions and 4 deletions

View File

@ -313,18 +313,18 @@ def init_bids(
def init_dicom_study(
dicom_study_ds: dlad.Dataset,
gitlab_group_path: str,
gitlab_group_path: pathlib.Path,
) -> None:
shutil.copytree(
"repo_templates/dicom_study", dicom_study_ds.path, dirs_exist_ok=True
)
env = {
"variables": {
"STUDY_PATH": gitlab_group_path,
"BIDS_PATH": f"{gitlab_group_path}/bids",
"STUDY_PATH": str(gitlab_group_path),
"BIDS_PATH": str(gitlab_group_path / "bids"),
}
}
with open(os.path.join(dicom_study_ds.path, "ci-env.yml"), "w") as outfile:
with (pathlib.Path(dicom_study_ds.path) / "ci-env.yml").open("w") as outfile:
yaml.dump(env, outfile, default_flow_style=False)
dicom_study_ds.save(path=".", message="init structure and pipelines")
dicom_study_ds.push(to="origin")