Skip to content

Commit

Permalink
If operating in custom setup with BIDS_DIR set -- pass it at datalad-…
Browse files Browse the repository at this point in the history
…container level
  • Loading branch information
yarikoptic committed Nov 11, 2024
1 parent e611c33 commit d06179f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/reproin
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ function setup_containers() {
# add bind mounts since we managed to contain it all nicely due to use
# of datalad to manage/create hierarchy within heudiconv
# TODO: make it so inside would not rely/really need hierarchy but also gets input data
cfg=datalad."containers.repronim-reproin".cmdexec ; git config -f .datalad/config "${cfg}" | sed -e "s,{img},-B '$dicomdir' -B '$bidsdir' {img},g" | tr -d '\n' | xargs -0 git config -f .datalad/config ${cfg}
if [ -n "$BIDS_DIR" ]; then
# if custom folder is used, pass that env and use it to bind-mount
bids_mount='-B "$BIDS_DIR" --env "BIDS_DIR=$BIDS_DIR"'
else
bids_mount='-B "$bidsdir"'
fi
cfg=datalad."containers.repronim-reproin".cmdexec ; git config -f .datalad/config "${cfg}" | sed -e "s,{img},-B '$dicomdir' $bids_mount {img},g" | tr -d '\n' | xargs -0 git config -f .datalad/config ${cfg}
datalad save -m "Saving tune ups to enable using the embedded container with reproin" .gitmodules .datalad/config
}

Expand Down

0 comments on commit d06179f

Please sign in to comment.