-
Notifications
You must be signed in to change notification settings - Fork 3
/
dataladSetUp.sh
executable file
·64 lines (46 loc) · 1.95 KB
/
dataladSetUp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
root_dir=${PWD}
raw_dir=${root_dir}/inputs/raw
derivatives_dir=${root_dir}/outputs/derivatives
preproc_dir=${derivatives_dir}/bidspm-preproc
stats_dir=${derivatives_dir}/bidspm-stats
# get url of the gin repos from config
source dataladConfig.sh
# install raw dataset
datalad install -d . -s "${URL_RAW}" "${raw_dir}"
# create the derivatives universe of classic sub-subdatasets ()
# . outputs
# └── derivatives
# ├── bidspm-preproc
# └── bidspm-stats
datalad create -d . "${derivatives_dir}"
if [ ! -z "${GIN_BASENAME}" ]; then
cd "${derivatives_dir}"
datalad create-sibling-gin -d . -s origin --access-protocol ssh --private cpp_brewery/"${GIN_BASENAME}"-derivatives
cd "${root_dir}"
datalad subdatasets --set-property url [email protected]:/cpp_brewery/"${GIN_BASENAME}"-derivatives.git "${derivatives_dir}"
fi
cd "${derivatives_dir}"
datalad create -d . "${preproc_dir}"
if [ ! -z "${GIN_BASENAME}" ]; then
cd "${preproc_dir}"
datalad create-sibling-gin -d . -s origin --access-protocol ssh --private cpp_brewery/"${GIN_BASENAME}"-derivatives-bidspm-preproc
cd "${derivatives_dir}"
datalad subdatasets --set-property url [email protected]:/cpp_brewery/"${GIN_BASENAME}"-derivatives-bidspm-preproc.git bidspm-preproc
fi
cd "${derivatives_dir}"
datalad create -d . "${stats_dir}"
if [ ! -z "${GIN_BASENAME}" ]; then
cd "${stats_dir}"
datalad create-sibling-gin -d . -s origin --access-protocol ssh --private cpp_brewery/"${GIN_BASENAME}"-derivatives-bidspm-stats
cd "${derivatives_dir}"
datalad subdatasets --set-property url [email protected]:/cpp_brewery/"${GIN_BASENAME}"-derivatives-bidspm-stats.git bidspm-stats
fi
cd "${derivatives_dir}"
datalad push --to origin -r
cd "${root_dir}"
datalad save -m "add code and folders to set subdatasets"
datalad push --to origin
echo "############################"
echo "# DATALAD IS READY TO WORK #"
echo "############################"