From e73ef2504c16967cec7d7aa7a5b9cc22364c77c7 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Fri, 29 Mar 2019 17:42:41 +0100 Subject: [PATCH] add update.sh --- update.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..69da820 --- /dev/null +++ b/update.sh @@ -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" \ No newline at end of file