Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6d02a0a71 |
+1
-1
Submodule RaspberryIO_26 updated: 800b81d88f...97ca122560
@@ -1,19 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
function look_for_update() {
|
||||
if [[ $1 == ./.* ]] || [[ $1 == "." ]]; then
|
||||
if [[ $1 == ./.git ]] || [[ $1 == "." ]]; then
|
||||
echo "Ignore $1"
|
||||
return
|
||||
fi
|
||||
printf -v quotedFile '%q' "$1"
|
||||
if [[ -f $quotedFile/update.sh ]]; then
|
||||
WithoutPrefix=$(echo -n $1 | cut -c 2-)
|
||||
if grep -qx "$WithoutPrefix" .gitignore; then
|
||||
echo "Ignore $1, because it's in .gitignore"
|
||||
return
|
||||
fi
|
||||
printf -v FolderNameEscaped '%q' "$1"
|
||||
if [[ -f $1/update.sh ]]; then
|
||||
echo "Switch to subdir $1 and run update.sh"
|
||||
cd "$1"
|
||||
bash -c ./update.sh
|
||||
bash -c "./update.sh nobreak"
|
||||
else
|
||||
echo "Pull $quotedFile"
|
||||
if [[ -f $1/.git ]]
|
||||
then
|
||||
echo "Pull $1"
|
||||
cd "$1"
|
||||
git pull
|
||||
else
|
||||
echo "Checkout master for $1"
|
||||
git submodule update --init -- "$1"
|
||||
cd "$1"
|
||||
git checkout master
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
export -f look_for_update
|
||||
find . -maxdepth 1 -type d -exec bash -c 'look_for_update "$0"' {} \;
|
||||
read -p "Press return"
|
||||
|
||||
if [ -z $1 ]; then
|
||||
read -p "Press return"
|
||||
fi
|
||||
Reference in New Issue
Block a user