From 44473d6832dd827d9301ba50bbeb35a43a1c474c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 5 Oct 2024 03:52:50 +0100 Subject: git.sh: fix error with cache re-download in some cases, on a fresh clone, the cached repo already exists but lbmk tries to download it again. work around this by checking that the directory exists; it's in the main if statement, so that the "else" still applies. as a result, the fallback to a live repo would un-fall back to doing git-pull if the cached directory exists exists. if it doesn't seem to make sense, it's because it doesn't. this whole function needs to be rewritten better. Signed-off-by: Leah Rowe --- include/git.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/git.sh b/include/git.sh index 0c2f7acc..2c43cd22 100644 --- a/include/git.sh +++ b/include/git.sh @@ -103,9 +103,9 @@ tmpclone() repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3" mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo" - if [ "$livepull" = "y" ]; then + if [ "$livepull" = "y" ] && [ ! -d "$repodir" ]; then git clone $1 "$repodir" || git clone $2 "$repodir" || \ - $err "!clone $1 $2 $repodir $4 $5" + $err "!clone $1 $2 $repodir $4 $5" # elif [ -d "$repodir" ] && [ $# -lt 6 ]; then git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \ || sleep 3 || git -C "$repodir" pull || : -- cgit v1.2.1