From 0de880c68dce8c4b7248f4c0fe1bac3ac6614b09 Mon Sep 17 00:00:00 2001 From: kevlahnota Date: Wed, 23 Oct 2024 07:42:34 +0800 Subject: [PATCH] update rename script --- .github/workflows/snapshots-pc.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/snapshots-pc.yml b/.github/workflows/snapshots-pc.yml index c74ef353f60..829d43a5d6d 100644 --- a/.github/workflows/snapshots-pc.yml +++ b/.github/workflows/snapshots-pc.yml @@ -61,22 +61,16 @@ jobs: mv /home/runner/work/forge/forge/forge-installer/*/*.{bz2,jar} izpack/ cd izpack d=$(date +%m.%d) - ls - # rename files - jar_file=$(find . -maxdepth 1 -type f -name '*.jar' -print -quit) - if [ -n "$jar_file" ]; then + # rename files + for file in *.jar; do 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 + done + for file in *.bz2; do outb="$(basename -s .tar.bz2 *)" mv "${outb}.tar.bz2" "${outb}-${d}.tar.bz2" - else - echo "No .bz2 files found in the specified folder." - fi + done + ls - name: 📂 Sync files uses: SamKirkland/FTP-Deploy-Action@v4.3.4