From 43a9e4eb977477275086b65bc5337f520499e08e Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 14 Feb 2020 23:06:27 -0300 Subject: Improve error message of tidy-content.sh --- default.nix | 6 +++++- scripts/tidy-content.sh | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index 537c2ae..2f10691 100644 --- a/default.nix +++ b/default.nix @@ -37,7 +37,11 @@ in rec { buildPhase = '' patchShebangs . jekyll build -d $out - ./scripts/tidy-content.sh $out + ./scripts/tidy-content.sh $out || { + echo 'Error in formatting HTML. Reproduce with: ' + echo ' jekyll build && ./scripts/tidy-content.sh _site/' + exit 1 + } ''; }); }; diff --git a/scripts/tidy-content.sh b/scripts/tidy-content.sh index 2ccb925..6dc13c6 100755 --- a/scripts/tidy-content.sh +++ b/scripts/tidy-content.sh @@ -26,12 +26,8 @@ INPUT_DIR="${1:-}" } format() { - FILE="${1}" - echo "${FILE}" >&2 - if ! tidy --quiet yes -utf8 -indent -modify "${FILE}"; then - echo "Error in formatting '${FILE}'." >&2 - exit 1 - fi + echo "${1}" >&2 + tidy --quiet yes -utf8 -indent -modify "${1}" } export -f format -- cgit v1.2.3