#!/usr/bin/env bash . .//setgin.sh ## this will be taken for the previous code projectname="testproject" projectdir=${HOME}/datasets/${projectname} ##Inputs if made a function: submodule="raw_data" folder="10_raw_data2" ## create repo with readme, no issues echo "Creating ${submodule} submodule ${projectname}.${submodule}" createrepot ${projectname}.${submodule} addrepototeam ${projectname}.${submodule} ${projectteam} issuetrackeroption ${projectname}.${submodule} false ## add repo to parent (cloned version) git -C ${projectdir} submodule add git@${ginssh}:/${organisation}/${projectname}.${submodule} ${folder} git -C ${projectdir} submodule sync ## not working: initialise git annex in submodule git -C ${projectdir} submodule foreach git annex init ## add to .gitmodules file and sync parent with server datalad -C ${projectdir} add --to-git .gitmodules --message "Initialise submodules" datalad -C ${projectdir} publish --recursive ## sync via gin to have submodules on gin server cd ${projectdir} gin sync