Add recursion to git_updated function
This way it's possible to use the function to check subdirectories
This commit is contained in:
parent
b788b4171c
commit
25ce97a7f8
|
@ -81,22 +81,30 @@ function kenter(){
|
||||||
kubectl exec -ti $1 $2 $3 $command
|
kubectl exec -ti $1 $2 $3 $command
|
||||||
}
|
}
|
||||||
|
|
||||||
# Comprueba que los repositorios git de un repositorio tienen commits a hacer
|
# Check that the directories of the main directory are updated git repos
|
||||||
function git_updated() {
|
function git_updated() {
|
||||||
for git in `ls --color=none`
|
local ROOT=`pwd`
|
||||||
|
local gitstatus
|
||||||
|
|
||||||
|
for dir in `ls --color=none | grep -v Archive`
|
||||||
do
|
do
|
||||||
if [[ -d $git ]]
|
if [[ -d $dir ]]
|
||||||
then
|
|
||||||
cd $git
|
|
||||||
gitstatus="`git status -s | awk '{print $2}'`"
|
|
||||||
|
|
||||||
if [[ -n $gitstatus ]]
|
|
||||||
then
|
then
|
||||||
echo "- \033[0;31m$git\033[0m:\n$gitstatus"
|
cd $dir
|
||||||
|
if [[ -d .git ]]
|
||||||
|
then
|
||||||
|
gitstatus="`git status -s | awk '{print $2}'`"
|
||||||
|
cd $ROOT
|
||||||
|
if [[ -n $gitstatus ]]
|
||||||
|
then
|
||||||
|
echo "- \033[0;31m$dir\033[0m:\n$gitstatus"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Recursion at it's finest
|
||||||
|
git_updated
|
||||||
|
cd $ROOT
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue