Workflow: pdf input defaults to empty (dry run falls back to the Clark regression sample)
This commit is contained in:
@@ -9,9 +9,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
pdf:
|
pdf:
|
||||||
description: 'PDF path inside the repo (empty = every PDF waiting in _incoming/)'
|
description: 'PDF path inside the repo (empty = every PDF waiting in _incoming/; a dry run with nothing waiting uses the Clark book as a regression sample)'
|
||||||
required: false
|
required: false
|
||||||
default: 'books/clark-glenn/the-man-who-tapped-the-secrets-of-the-universe/The Man Who Tapped the Secrets of the Universe - by Glenn Clark (Walter Russell).pdf'
|
default: ''
|
||||||
voice_endpoint:
|
voice_endpoint:
|
||||||
description: 'Testing only: use this voice URL instead of the default (for example to prove a failed voice run commits nothing)'
|
description: 'Testing only: use this voice URL instead of the default (for example to prove a failed voice run commits nothing)'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ if [ -n "${PDF_INPUT:-}" ]; then
|
|||||||
else
|
else
|
||||||
while IFS= read -r f; do pdfs+=("$f"); done < <(find _incoming -maxdepth 1 -type f -iname '*.pdf' | sort)
|
while IFS= read -r f; do pdfs+=("$f"); done < <(find _incoming -maxdepth 1 -type f -iname '*.pdf' | sort)
|
||||||
fi
|
fi
|
||||||
|
CLARK_PDF="books/clark-glenn/the-man-who-tapped-the-secrets-of-the-universe/The Man Who Tapped the Secrets of the Universe - by Glenn Clark (Walter Russell).pdf"
|
||||||
|
if [ "${#pdfs[@]}" -eq 0 ] && [ "$DRY_RUN" = "true" ]; then
|
||||||
|
echo "Dry run with nothing in _incoming/: using the Clark book as a regression sample."
|
||||||
|
sparse_add "/$(esc "$CLARK_PDF")"
|
||||||
|
pdfs=("$CLARK_PDF")
|
||||||
|
fi
|
||||||
if [ "${#pdfs[@]}" -eq 0 ]; then
|
if [ "${#pdfs[@]}" -eq 0 ]; then
|
||||||
echo "Nothing to do: no PDF in _incoming/."
|
echo "Nothing to do: no PDF in _incoming/."
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user