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