mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 12:52:10 +00:00
Switch from find -exec to xargs
This commit is contained in:
parent
bf7423e44a
commit
ceac2c2a57
1 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,8 @@
|
||||||
# Runs xhtmlize-single-file.sh on every single html file in the output dir.
|
# Runs xhtmlize-single-file.sh on every single html file in the output dir.
|
||||||
# exits if xhtmlize-single-file fails.
|
# exits if xhtmlize-single-file fails.
|
||||||
|
|
||||||
# no pipefail here since there are no pipes.
|
#shellcheck disable=SC3040 # This only sets pipefail if it's available and otherwise does nothing
|
||||||
|
set -o pipefail 2>/dev/null || true
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
output_dir="$1"
|
output_dir="$1"
|
||||||
|
@ -25,5 +26,5 @@ trap cleanup EXIT
|
||||||
|
|
||||||
export XMLLINT_INDENT=' '
|
export XMLLINT_INDENT=' '
|
||||||
export OUTPUT_DIR="$output_dir"
|
export OUTPUT_DIR="$output_dir"
|
||||||
find "$output_dir" -type f -name '*.html' -exec sh "$script_dir/xhtmlize-single-file.sh" {} \;
|
find "$output_dir" -type f -name '*.html' | xargs -n1 sh "$script_dir/xhtmlize-single-file.sh"
|
||||||
find "$output_dir" -type f -name '*.xml' -exec xmllint --noblanks --encode UTF-8 --noent {} --output {} \;
|
find "$output_dir" -type f -name '*.xml' | xargs -I_ xmllint --noblanks --encode UTF-8 --noent _ --output _
|
||||||
|
|
Loading…
Reference in a new issue