mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 09:31:11 +00:00
Update shell-format.yml
This commit is contained in:
14
.github/workflows/shell-format.yml
vendored
14
.github/workflows/shell-format.yml
vendored
@@ -25,12 +25,18 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mapfile -d '' FILES < <(git ls-files -z '*.sh' 'mole' || true)
|
count=0
|
||||||
if (( ${#FILES[@]} == 0 )); then
|
: > 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"
|
echo "found=0" >> "$GITHUB_OUTPUT"
|
||||||
|
rm -f files-null.list
|
||||||
else
|
else
|
||||||
printf '%s\0' "${FILES[@]}" > files-null.list
|
echo "found=$count" >> "$GITHUB_OUTPUT"
|
||||||
echo "found=${#FILES[@]}" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run shfmt (diff mode, indent=4, simplify)
|
- name: Run shfmt (diff mode, indent=4, simplify)
|
||||||
|
|||||||
Reference in New Issue
Block a user