diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cabe1f0..eca52b1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -179,11 +179,12 @@ jobs: shell: bash run: | set -euo pipefail + echo "[Duplicate Skin Name Check Started]" - # Ensure DANSER_SKINS_DIR is set and valid + # Guard: ensure DANSER_SKINS_DIR is set and exists if [ -z "${DANSER_SKINS_DIR:-}" ] || [ ! -d "${DANSER_SKINS_DIR}" ]; then - echo "DANSER_SKINS_DIR is not set or is not a directory. Exiting." + echo "DANSER_SKINS_DIR is not set or not a directory. Exiting." exit 1 fi @@ -206,7 +207,7 @@ jobs: ini=$(find "$dir" -maxdepth 1 -iname "skin.ini" | head -n1 || true) if [ -f "$ini" ]; then - line=$(grep -i '^[[:space:]]*Name:' "$ini" | head -n1) + line=$(grep -i '^[[:space:]]*Name:' "$ini" | head -n1 || true) if [ -n "${line:-}" ]; then val="${line#*:}" val=$(echo "$val" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') @@ -218,9 +219,9 @@ jobs: done shopt -u nullglob - for name in "${!name_counts[@]}"; do - if [ "${name_counts[$name]}" -gt 1 ]; then - duplicates+=("$name (${name_counts[$name]} skins)") + for nm in "${!name_counts[@]}"; do + if [ "${name_counts[$nm]}" -gt 1 ]; then + duplicates+=("$nm (${name_counts[$nm]} skins)") fi done