Add _headers file checking logic (#9879)

* Add _headers file checking logic

* Remove netlify_noindex_headers.txt file
This commit is contained in:
Luc Perkins
2018-08-21 12:51:15 -07:00
committed by k8s-ci-robot
parent 7360a0c10c
commit b6bb3a60a0
5 changed files with 35 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/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