add update.sh

This commit is contained in:
BlubbFish 2019-03-29 17:42:41 +01:00
parent 831c3dfc54
commit e73ef2504c

19
update.sh Normal file
View File

@ -0,0 +1,19 @@
function look_for_update() {
if [[ $1 == ./.* ]] || [[ $1 == "." ]]; then
return
fi
printf -v quotedFile '%q' "$1"
if [[ -f $quotedFile/update.sh ]]; then
echo "Switch to subdir $1 and run update.sh"
cd "$1"
bash -c ./update.sh
else
echo "Pull $quotedFile"
cd "$1"
git pull
fi
}
export -f look_for_update
find . -maxdepth 1 -type d -exec bash -c 'look_for_update "$0"' {} \;
read -p "Press return"