Keep cloned repos to keep build cache and save time

This commit is contained in:
DarkCat09 2024-04-08 12:30:37 +04:00
parent 5511823a73
commit d56975633f
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -25,6 +25,19 @@ cd_and_exec () {
cd "$old" || exit 3
}
update_repo () {
if [ -e "$1" ]
then
echo "$1 exists, updating"
cd "$1" || return 3
git stash && git stash drop
git pull
else
echo "$1 not found, cloning"
clone "$2" "$1"
fi
}
try_exec () {
"$@"
return 0
@ -50,9 +63,9 @@ dep java
dep cargo
dep 7z
title 'Cloning repositories...'
[ -e backend ] || clone https://github.com/TeamPiped/Piped-Backend backend
[ -e reqwest4j ] || clone https://github.com/TeamPiped/reqwest4j reqwest4j
title 'Updating repositories...'
update_repo backend https://github.com/TeamPiped/Piped-Backend
update_repo reqwest4j https://github.com/TeamPiped/reqwest4j
title 'Applying patches...'
source patcher.sh
@ -143,9 +156,6 @@ cd_and_exec backend/build/libs \
title 'Copying config and version...'
cd_and_exec backend cp config.properties VERSION "$WORKDIR"
title 'Cleaning up...'
rm -rf backend reqwest4j
# ---
echo