From 1823de194d13a7207043627aec75c0aa9eebc995 Mon Sep 17 00:00:00 2001 From: SoundDrill31 <84176052+sounddrill31@users.noreply.github.com> Date: Mon, 5 Aug 2024 00:09:19 +0530 Subject: [PATCH] Export the previous variable and fix the rm command --- .github/workflows/main.yml | 4 ++-- .github/workflows/selfhosted.yml | 4 ++-- .github/workflows/twrp-legacy.yml | 4 ++-- .github/workflows/twrp.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9d2415b..24a79ef7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -150,8 +150,8 @@ jobs: #copy from here if [[ "${{ github.event.inputs.LOCAL_MANIFEST }}" =~ \.xml(/)?$ ]]; then local_manifest_url="${{ github.event.inputs.LOCAL_MANIFEST }}" - local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists - export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") + export local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists + export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* || true && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") else export LOCAL_MANIFEST="git clone ${{ github.event.inputs.LOCAL_MANIFEST }} --depth 1 -b ${github.event.inputs.LOCAL_MANIFEST_BRANCH} local_manifests" fi diff --git a/.github/workflows/selfhosted.yml b/.github/workflows/selfhosted.yml index edca5cae..c41312fd 100644 --- a/.github/workflows/selfhosted.yml +++ b/.github/workflows/selfhosted.yml @@ -187,8 +187,8 @@ jobs: if [[ "${{ github.event.inputs.LOCAL_MANIFEST }}" =~ \.xml(/)?$ ]]; then local_manifest_url="${{ github.event.inputs.LOCAL_MANIFEST }}" - local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists - export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") + export local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists + export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* || true && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") else export LOCAL_MANIFEST="git clone ${{ github.event.inputs.LOCAL_MANIFEST }} --depth 1 -b ${github.event.inputs.LOCAL_MANIFEST_BRANCH} local_manifests" fi diff --git a/.github/workflows/twrp-legacy.yml b/.github/workflows/twrp-legacy.yml index b40bda26..5c624ae9 100644 --- a/.github/workflows/twrp-legacy.yml +++ b/.github/workflows/twrp-legacy.yml @@ -100,8 +100,8 @@ jobs: if [[ "${{ github.event.inputs.LOCAL_MANIFEST }}" =~ \.xml(/)?$ ]]; then local_manifest_url="${{ github.event.inputs.LOCAL_MANIFEST }}" - local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists - export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") + export local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists + export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* || true && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") else export LOCAL_MANIFEST="git clone ${{ github.event.inputs.LOCAL_MANIFEST }} --depth 1 -b ${github.event.inputs.LOCAL_MANIFEST_BRANCH} local_manifests" fi diff --git a/.github/workflows/twrp.yml b/.github/workflows/twrp.yml index 0a315df3..3efc4afc 100644 --- a/.github/workflows/twrp.yml +++ b/.github/workflows/twrp.yml @@ -100,8 +100,8 @@ jobs: if [[ "${{ github.event.inputs.LOCAL_MANIFEST }}" =~ \.xml(/)?$ ]]; then local_manifest_url="${{ github.event.inputs.LOCAL_MANIFEST }}" - local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists - export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") + export local_manifest_url="${local_manifest_url%/}" # remove trailing slash if it exists + export LOCAL_MANIFEST=$(mkdir -p .repo/local_manifests && rm -rf .repo/local_manifests/* || true && curl -o .repo/local_manifests/local_manifest.xml "${local_manifest_url}") else export LOCAL_MANIFEST="git clone ${{ github.event.inputs.LOCAL_MANIFEST }} --depth 1 -b ${github.event.inputs.LOCAL_MANIFEST_BRANCH} local_manifests" fi