From 530505054645b61b81f1d41a2d50d00e1a5157a7 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 22 Oct 2024 06:25:05 +0800 Subject: [PATCH] update snapshot-pc workflow --- .github/workflows/snapshots-pc.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/snapshots-pc.yml b/.github/workflows/snapshots-pc.yml index b125797e69b..f433ee44a3f 100644 --- a/.github/workflows/snapshots-pc.yml +++ b/.github/workflows/snapshots-pc.yml @@ -61,12 +61,22 @@ jobs: mv /home/runner/.m2/repository/forge/forge-installer/*/*.bz2 izpack/ cd izpack d=$(date +%m.%d) - # rename installer - outj="$(basename -s .jar *)" - mv "${outj}.jar" "${outj}-${d}.jar" - # rename archive - outb="$(basename -s .tar.bz2 *)" - mv "${outb}.tar.bz2" "${outb}-${d}.tar.bz2" + ls + # rename files + jar_file=$(find . -maxdepth 1 -type f -name '*.jar' -print -quit) + if [ -n "$jar_file" ]; then + outj="$(basename -s .jar *)" + mv "${outj}.jar" "${outj}-${d}.jar" + else + echo "No .jar files found in the specified folder." + fi + bz2_file=$(find . -maxdepth 1 -type f -name '*.bz2' -print -quit) + if [ -n "$bz2_file" ]; then + outb="$(basename -s .tar.bz2 *)" + mv "${outb}.tar.bz2" "${outb}-${d}.tar.bz2" + else + echo "No .bz2 files found in the specified folder." + fi - name: 📂 Sync files uses: SamKirkland/FTP-Deploy-Action@v4.3.4