Update submodules when done

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
Václav Valíček 2022-06-25 22:46:35 +02:00
parent 2273937324
commit 420646e2d7
Signed by: valicek
GPG Key ID: FF05BDCA0C73BB31

View File

@ -1,3 +1,4 @@
echo un: $uninitialized
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
@ -14,13 +15,14 @@ then
invoker="\e[{${invoker:-}\e\\" invoker="\e[{${invoker:-}\e\\"
[ -z "${invoker}" ] || echo -e "Invoked from $invoker" [ -z "${invoker}" ] || echo -e "Invoked from $invoker"
# prepare submodules # prepare submodules
sed -i 's/git@git.sw3.cz:/https:\/\/git.sw3.cz\//g' .gitmodules
green "Preparing submodules..." green "Preparing submodules..."
git submodule | awk '{print $2}' | while read submodule git submodule | awk '{print $2}' | while read submodule
do do
echo "Submodule: $submodule" echo "Submodule: $submodule"
if [ ! -d "$submodule/.git" ] if [ ! -d "$submodule/.git" ]
then then
echo "Moudle is unitialized..." echo " -> module is unitialized..."
touch .uninitialized touch .uninitialized
fi fi
done done
@ -29,7 +31,7 @@ then
then then
green "submodule init & sync" green "submodule init & sync"
git submodule init git submodule init
git submodule sync git submodule update
rm .uninitialized rm .uninitialized
fi fi