Created
July 17, 2018 16:39
-
-
Save i4kimura/e361728311a0673d07cf61dd77910b2c to your computer and use it in GitHub Desktop.
Submodule All Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
except_list=( "riscv-tools" "riscv-linux" ) | |
function submodule_update() { | |
echo "Submodule updating in " ${PWD} "..." | |
git submodule init | |
submodule_list=`git submodule status | sed 's/^ *//g' | cut -f2 -d' '` | |
for except in ${except_list[@]} | |
do | |
submodule_list=`echo ${submodule_list} | sed s/${except}//g` | |
done | |
for sub in `echo -n ${submodule_list}` | |
do | |
git submodule update --init ${sub} | |
pushd ${sub} > /dev/null | |
submodule_update | |
popd > /dev/null | |
done | |
} | |
submodule_update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment