]> git.parisson.com Git - docker-django-scripts.git/commitdiff
Merge branch 'master' of github.com:Ircam-Web/mezzo-bin
authorEmilie <zawadzki@ircam.fr>
Thu, 26 Oct 2017 17:22:59 +0000 (19:22 +0200)
committerEmilie <zawadzki@ircam.fr>
Thu, 26 Oct 2017 17:27:04 +0000 (19:27 +0200)
1  2 
update_submodules.sh

index 4e687a15516714df0f0939d6354f31df56cf7fe1,0000000000000000000000000000000000000000..ea1f599518461ea96599a9d628984eeea8bb46b7
mode 100755,000000..100755
--- /dev/null
@@@ -1,25 -1,0 +1,25 @@@
- echo $curr_branch
 +#!/bin/bash
 +
 +# The script detect the right main project branch, then update the submodule function of branch-[mainProjectBranch]
 +# For example, if you define these variables in .gitmodules :
 +# - branch-dev
 +# - branch-master
 +# If you are on dev branch in main project, the script will update submodule functions of branch-dev you've defined
 +# In main project, if you are in another branch than master or dev, it will take by default dev branch
 +# If you don't define any branches for you submodule, the script will update from master
 +
 +curr_branch=$(git symbolic-ref --short HEAD)
 +
 +echo $curr_branch
 +if [ $curr_branch != "master" ] && [ $curr_branch != "dev" ];
 +then
 +    curr_branch="dev"
 +fi
 +
++
 +#Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules
 +git submodule sync
 +# Checkout all submodules on right branches specified in .gitmodules, by default the branch is master
 +git submodule foreach --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch-'$curr_branch' || echo master)'
 +# Pull all submodules on right branches specified in .gitmodules, by default the branch is master
 +git submodule foreach --recursive 'git pull origin $(git config -f $toplevel/.gitmodules submodule.$name.branch-'$curr_branch' || echo master)'