hurl/integration/bin/format_to_html.sh
2020-11-16 22:18:16 +01:00

20 lines
373 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
for hurl_file in "$@"; do
html_file="${hurl_file%.*}".html
cmd="hurlfmt --format html $hurl_file"
echo "$cmd"
$cmd >/tmp/test.stdout
expected=$(cat "$html_file")
actual=$(cat /tmp/test.stdout)
if [ "$actual" != "$expected" ]; then
diff <(echo "$actual" ) <(echo "$expected")
exit 1
fi
done