Update update.sh
This commit is contained in:
parent
e90dfec1a0
commit
86bff6634e
2
Builds
2
Builds
@ -1 +1 @@
|
|||||||
Subproject commit fe53686fbe13a10fa3a0e67a788e07d45769dc7b
|
Subproject commit 3765bd0c6a4375a13ccff67bceae87790d48534c
|
2
Librarys
2
Librarys
@ -1 +1 @@
|
|||||||
Subproject commit edae4170e3558804cd5573f57182c88a4b7798ec
|
Subproject commit c6d02a0a71a60718a1086c2f6133cb74351004fc
|
2
Lora
2
Lora
@ -1 +1 @@
|
|||||||
Subproject commit 0a4f2b3efb35b6fb53890b73186fbb0a8b384540
|
Subproject commit 5d5d06b15a7c305ed5c301dc420ad9467e260b15
|
2
Lora-Bot
2
Lora-Bot
@ -1 +1 @@
|
|||||||
Subproject commit 6b2df85092d176147281d805395e47f50be91788
|
Subproject commit 67b9729d04e43ebdc42e1b05ba621de42a74d9dd
|
2
Lora-Map
2
Lora-Map
@ -1 +1 @@
|
|||||||
Subproject commit f192cc7b52150468606c5a5944ec0eb4b6da0fbd
|
Subproject commit 7dc841fe5cf291bc32020750f6161ef7ff852aee
|
@ -1 +1 @@
|
|||||||
Subproject commit e92178c17dd508d7b0f69df093ee05a818a94410
|
Subproject commit 0ea8762cf27f575aed9ae57e3e820ad6e8398aea
|
@ -1 +1 @@
|
|||||||
Subproject commit e8c82f9355c9f27d485390e9f793fea999479f83
|
Subproject commit aa8d313884f25b636006bd1cdcaffa99a796df5a
|
2
Utils
2
Utils
@ -1 +1 @@
|
|||||||
Subproject commit eea28bb0fb727287b13d104a99b8d4446ede63a2
|
Subproject commit 12192127269f1daf8f5a211373d7cbf284db88d4
|
45
update.sh
45
update.sh
@ -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
|
Loading…
Reference in New Issue
Block a user