add update.sh
This commit is contained in:
parent
831c3dfc54
commit
e73ef2504c
19
update.sh
Normal file
19
update.sh
Normal 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"
|
Loading…
Reference in New Issue
Block a user