1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00

Update shell-format.yml

This commit is contained in:
Tw93
2025-10-12 17:58:11 +08:00
committed by GitHub
parent b61a3659d3
commit 3be86923f5

View File

@@ -25,12 +25,18 @@ jobs:
shell: bash
run: |
set -euo pipefail
mapfile -d '' FILES < <(git ls-files -z '*.sh' 'mole' || true)
if (( ${#FILES[@]} == 0 )); then
count=0
: > files-null.list
while IFS= read -r -d '' f; do
printf '%s\0' "$f" >> files-null.list
count=$((count+1))
done < <(git ls-files -z '*.sh' 'mole' || true)
if [[ $count -eq 0 ]]; then
echo "found=0" >> "$GITHUB_OUTPUT"
rm -f files-null.list
else
printf '%s\0' "${FILES[@]}" > files-null.list
echo "found=${#FILES[@]}" >> "$GITHUB_OUTPUT"
echo "found=$count" >> "$GITHUB_OUTPUT"
fi
- name: Run shfmt (diff mode, indent=4, simplify)