Last active
August 28, 2017 09:40
-
-
Save pserrano/37146adfda6c1dc94bb81bbb69beb756 to your computer and use it in GitHub Desktop.
Gitsuperpull
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 | |
DIRS=($(ls -d */)) | |
PWD=($(pwd)) | |
GIT="/.git/" | |
for i in "${DIRS[@]}"; do | |
if [[ "$i" == "parameters/" ]] || [[ "$i" == "jenkinsfile/" ]]; then | |
cd $i; PARA=($(ls -d */)); | |
echo $i | |
for j in "${PARA[@]}"; do | |
echo $j | |
echo "Se empieza la actualización del repo $j" | |
cd $j; git fetch --all; git pull --all; cd .. | |
done | |
cd .. | |
else | |
echo "Se empieza la actualización del repo $i" | |
cd $i; | |
if [ ! -d "$PWD$GIT" ]; then | |
echo " El repositorio no es un repo git, Se pasa a siguiente directorio" | |
cd .. | |
else | |
git fetch --all; git pull --all; git submodule update; cd .. | |
fi | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment