Files
website/scripts/hugo-version-check.sh
T
Luc Perkins aac7862a06 Upgrade Hugo to 0.52 (#11552)
* Update Hugo version and apply HTML minification to production builds

* Use full flag names for clarity

* Remove Hugo installation logic out of Travis config and into Makefile

* Add Hugo version checking script

* Fix Netlify config version
2019-01-15 10:56:39 -08:00

19 lines
614 B
Bash
Executable File

#!/bin/bash
MAIN_HUGO_VERSION=$1
NETLIFY_HUGO_VERSION=$(cat netlify.toml | grep HUGO_VERSION | awk '{ print $3 }' | tr -d '"')
echo ${NETLIFY_HUGO_VERSION}
if [[ ${MAIN_HUGO_VERSION} != ${NETLIFY_HUGO_VERSION} ]]; then
echo """
[FAILURE] The Hugo version set in the Makefile is ${MAIN_HUGO_VERSION} while the version in netlify.toml is ${NETLIFY_HUGO_VERSION}
[FAILURE] Please update these versions so that they are same (consider the higher of the two versions as canonical).
"""
exit 1
else
echo "[SUCCESS] The Hugo versions match between the Makefile and netlify.toml"
exit 0
fi