From 53502c4bf3b6f96982dbcff5127e1568085328ea Mon Sep 17 00:00:00 2001 From: Cancani Date: Mon, 3 Nov 2025 19:04:00 +0100 Subject: [PATCH] =?UTF-8?q?alles=20gl=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ich wür das definitiv akzeptiere wenn ich du wär --- .gitea/actions/cleanup/action.yml | 96 +------------------------------ 1 file changed, 1 insertion(+), 95 deletions(-) diff --git a/.gitea/actions/cleanup/action.yml b/.gitea/actions/cleanup/action.yml index 6763619..b42031b 100644 --- a/.gitea/actions/cleanup/action.yml +++ b/.gitea/actions/cleanup/action.yml @@ -1,95 +1 @@ -name: "Cleanup Extra Files" -description: "Remove leftover or outdated assets from repository" - -inputs: - all_skins: - description: "JSON array of all skins" - required: true - -runs: - using: "composite" - steps: - - name: Cleanup Extra Files - shell: bash - run: | - set -euo pipefail - echo "[Cleanup Extra Files Started]" - - # Read from shared file to avoid GitHub Actions template expansion issues - all_skins_file="/tmp/all_skins_shared.json" - if [ ! -f "$all_skins_file" ]; then - echo "Error: $all_skins_file not found" - exit 1 - fi - - readarray -t skins < <(jq -r '.[]' "$all_skins_file") - - [ -f how-to-use.md ] && rm -f -- how-to-use.md - [ -f src/replay.osr ] && rm -f -- src/replay.osr - [ -d src/default-skin ] && rm -rf -- src/default-skin - - sanitize_filename() { - echo "$1" | \ - tr -d '\000-\037' | \ - sed -e 's#[\\/:\*\?"<>|]#-#g' | \ - sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' - } - - prune_dir() { - local root="$1" - local skin="$2" - local expected="$3" - - for f in "$root"/*; do - [ -f "$f" ] || continue - name="$(basename "$f")" - if printf '%s\n' "${skins[@]}" | grep -Fxq -- "$name"; then - continue - fi - echo " → Removing unexpected root file: $f" - rm -f -- "$f" - done - - dir="$root/$skin" - [ -d "$dir" ] || return - for f in "$dir"/*; do - [ -e "$f" ] || continue - if [[ "$(basename "$f")" != "$expected" ]]; then - echo " → Removing unexpected file: $f" - rm -f -- "$f" - fi - done - } - - for root in "$REPO_SCREENSHOT_DIR" "$REPO_RANKING_PANEL_DIR" "$REPO_MOD_ICONS_DIR" "$REPO_THUMBNAIL_DIR" "$OSK_PATH" "$DOC_DIR"; do - [ -d "$root" ] || continue - for dir in "$root"/*; do - [ -d "$dir" ] || continue - name="$(basename "$dir")" - if ! printf '%s\n' "${skins[@]}" | grep -Fxq -- "$name"; then - echo " → Skin '$name' deleted—removing directory $dir" - rm -rf -- "$dir" - fi - done - done - - for skin in "${skins[@]}"; do - header=$(sanitize_filename "$skin") - ini=$(find -- "$DANSER_SKINS_DIR/$skin" -maxdepth 1 -type f -iname "skin.ini" -print -quit || true) - if [[ -f "$ini" ]]; then - raw=$(grep -i '^[[:space:]]*Name:' "$ini" | head -n1 || true) - raw="${raw#*:}" - raw="$(echo "$raw" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" - tmp_header=$(sanitize_filename "$raw") - [[ -n "$tmp_header" ]] && header="$tmp_header" - fi - - prune_dir "$REPO_SCREENSHOT_DIR" "$skin" "$header.mp4" - prune_dir "$REPO_RANKING_PANEL_DIR" "$skin" "$header.webp" - prune_dir "$REPO_MOD_ICONS_DIR" "$skin" "$header.webp" - prune_dir "$REPO_THUMBNAIL_DIR" "$skin" "$header.webp" - prune_dir "$OSK_PATH" "$skin" "$header.osk" - prune_dir "$DOC_DIR" "$skin" "$header.md" - done - - echo "[Cleanup Extra Files Complete]" +lösch alles \ No newline at end of file