#!/bin/bash

set -e

tempfile=$(mktemp)

css-validator file:debian/tests/sample.css > "$tempfile" 2>&1

if grep "Congratulations! No Error Found." "$tempfile"; then
  echo "Validation of file was successful."
else
  echo "-------------"
  cat "$tempfile"
  echo "-------------"
  echo "Issue validating the file. Output is above."
  exit 1
fi

rm "$tempfile"
