From 7e48f047d422b354698c15e3182f36058de6a610 Mon Sep 17 00:00:00 2001 From: SoundDrill31 <84176052+sounddrill31@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:40:36 +0530 Subject: [PATCH] sadtoni.sh: Remove if cloned folder exists Git clone doesn't play nicely with existing files So we remove them if they exist, one by one. --- sadtoni.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sadtoni.sh b/sadtoni.sh index 1f47d942..8182878b 100644 --- a/sadtoni.sh +++ b/sadtoni.sh @@ -70,12 +70,24 @@ COMMIT_HEAD=$(git log --oneline -1) clone() { echo " " msg "|| Cloning GCC ||" + if [ -d "$KERNEL_DIR/gcc64" ]; then + echo "gcc64 folder found! Removing..." + rm -rf "$KERNEL_DIR/gcc64" || true; + fi + if [ -d "$KERNEL_DIR/gcc32" ]; then + echo "gcc32 folder found! Removing..." + rm -rf "$KERNEL_DIR/gcc32" || true; + fi git clone --depth=1 https://github.com/mvaisakh/gcc-arm64 -b gcc-new gcc64 git clone --depth=1 https://github.com/mvaisakh/gcc-arm -b gcc-new gcc32 GCC64_DIR=$KERNEL_DIR/gcc64 GCC32_DIR=$KERNEL_DIR/gcc32 msg "|| Cloning Anykernel ||" + if [ -d "$KERNEL_DIR/AnyKernel3" ]; then + echo "AnyKernel3 folder found! Removing..." + rm -rf "$KERNEL_DIR/AnyKernel3" || true; + fi git clone --depth 1 --no-single-branch https://github.com/Reinazhard/AnyKernel3.git -b sadtoni }