Files
website/scripts/check-headers-file.sh
Luc Perkins b6bb3a60a0 Add _headers file checking logic (#9879)
* Add _headers file checking logic

* Remove netlify_noindex_headers.txt file
2018-08-21 12:51:15 -07:00

17 lines
480 B
Bash
Executable File

#!/bin/bash
if [ "$HUGO_ENV" == "production" ]; then
echo "INFO: Production environment. Checking the _headers file for noindex headers."
if grep -q "noindex" public/_headers; then
echo "PANIC: noindex headers were found in the _headers file. This build has failed."
exit 1
else
echo "INFO: noindex headers were not found in the _headers file. All clear."
exit 0
fi
else
echo "Non-production environment. Skipping the _headers file check."
exit 0
fi