Files
linux_tools/bin/all-update.sh
2023-06-21 09:07:10 -04:00

75 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
git config --global credential.helper 'cache --timeout=604800'
cd $HOME
function do_git {
echo $1 "(Git)"
cd $1
git ls-remote --get-url
if [ -f .gitmodules ]; then
git pull --recurse-submodules
else
git pull
fi
cd ..
echo
}
function do_merc {
echo $1 "(Mercurial)"
cd $1
hg pull -uv
cd ..
echo
}
function do_svn {
echo $1 "(Subversion)"
cd $1
svn info --show-item url
svn update
cd ..
echo
}
function do_dir {
pwd
echo $1
echo "-----------------"
for i in *
do
if [ -d $i ]; then
if [ -d $i/.git ]; then
do_git $i
elif [ -d $i/.hg ]; then
do_merc $i
elif [ -d $i/.svn ]; then
do_svn $i
else
cd $i
do_dir $i
cd ..
fi
fi
done
}
for i in ProbeStar NTCNA Gits External
do
if [ "$i" == "ProbeStar" ]; then
$HOME/bin/pstar-update.sh
else
d=`echo "${i,,}"`
if [ -f $HOME/bin/$d-update.sh ]; then
$HOME/bin/$d-update.sh
elif [ -d $i ]; then
cd $i
do_dir $i
cd ..
fi
fi
done