Skip to content

Commit a25098c

Browse files
committed
Count archives
1 parent ac8cf88 commit a25098c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/swift-generate-and-publish-docs.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,14 @@ jobs:
211211
env:
212212
OUTPUT_PATH: ${{ inputs.repository }}-combined.doccarchive
213213
run: |
214-
find artifacts -type d -name '*.doccarchive' -print0 \
215-
| xargs --null --no-run-if-empty \
216-
sh -c "'$(which docc || xcrun --find docc)' merge \"\$@\" --output-path '${OUTPUT_PATH}'" sh
217-
# We could use `xargs -J` in POSIX - but GNU xargs doesn't have -J...
214+
if [ "$(find artifacts -type d -name '*.doccarchive' -print | wc -l)" -gt 1 ]; then
215+
# We could use `xargs -J` in POSIX - but GNU xargs doesn't have -J...
216+
find artifacts -type d -name '*.doccarchive' -print0 \
217+
| xargs --null --no-run-if-empty \
218+
sh -c "'$(which docc || xcrun --find docc)' merge \"\$@\" --output-path '${OUTPUT_PATH}'" sh
219+
else
220+
find artifacts -type d -name '*.doccarchive' -exec cp -R '{}' "$(realpath "${OUTPUT_PATH}")" \;
221+
fi
218222
- name: Package combined docs
219223
env:
220224
REPO_NAME: ${{ inputs.repository }}

0 commit comments

Comments
 (0)