hurl/integration/bin/echo.sh

20 lines
413 B
Bash
Raw Normal View History

2020-11-08 19:52:33 +03:00
#!/bin/bash
# echo hurl file
# The file is parsed and output exactly as the input
#
set -eo pipefail
for hurl_file in "$@"; do
cmd="hurlfmt --no-format $hurl_file"
echo "$cmd"
2020-11-21 12:04:45 +03:00
$cmd >/tmp/test.stdout
2020-11-08 19:52:33 +03:00
expected=$(cat "$hurl_file")
actual=$(cat "/tmp/test.stdout")
if [ "$actual" != "$expected" ]; then
echo "=> Difference!"
diff "/tmp/test.stdout" "$hurl_file"
exit &
fi
done