Update update.sh
This commit is contained in:
+1
-1
Submodule Builds updated: fe53686fbe...3765bd0c6a
+1
-1
Submodule Librarys updated: edae4170e3...c6d02a0a71
+1
-1
Submodule Lora updated: 0a4f2b3efb...5d5d06b15a
+1
-1
Submodule Lora-Bot updated: 6b2df85092...67b9729d04
+1
-1
Submodule Lora-Map updated: f192cc7b52...7dc841fe5c
+1
-1
Submodule Lora-Scral updated: e92178c17d...0ea8762cf2
+1
-1
Submodule TTN-Bridge updated: e8c82f9355...aa8d313884
+1
-1
Submodule Utils updated: eea28bb0fb...1219212726
@@ -1,19 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
function look_for_update() {
|
function look_for_update() {
|
||||||
if [[ $1 == ./.* ]] || [[ $1 == "." ]]; then
|
if [[ $1 == ./.git ]] || [[ $1 == "." ]]; then
|
||||||
return
|
echo "Ignore $1"
|
||||||
fi
|
return
|
||||||
printf -v quotedFile '%q' "$1"
|
fi
|
||||||
if [[ -f $quotedFile/update.sh ]]; then
|
WithoutPrefix=$(echo -n $1 | cut -c 2-)
|
||||||
echo "Switch to subdir $1 and run update.sh"
|
if grep -qx "$WithoutPrefix" .gitignore; then
|
||||||
cd "$1"
|
echo "Ignore $1, because it's in .gitignore"
|
||||||
bash -c ./update.sh
|
return
|
||||||
else
|
fi
|
||||||
echo "Pull $quotedFile"
|
printf -v FolderNameEscaped '%q' "$1"
|
||||||
cd "$1"
|
if [[ -f $1/update.sh ]]; then
|
||||||
git pull
|
echo "Switch to subdir $1 and run update.sh"
|
||||||
|
cd "$1"
|
||||||
|
bash -c "./update.sh nobreak"
|
||||||
|
else
|
||||||
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
export -f look_for_update
|
export -f look_for_update
|
||||||
find . -maxdepth 1 -type d -exec bash -c 'look_for_update "$0"' {} \;
|
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