From 80b836138f725ddd6b9939adea8b477d58e735e3 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 18 Mar 2020 13:23:50 -0700 Subject: [PATCH] Ensure Hugo is properly installed --- Makefile | 3 +++ check_hugo.sh | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100755 check_hugo.sh diff --git a/Makefile b/Makefile index e3a4165..d75001c 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ clean: rm -rf public resources serve: + @./check_hugo.sh hugo server \ --buildDrafts \ --buildFuture \ @@ -15,10 +16,12 @@ docker-serve: docker run --rm -it -v $(CURDIR):/src -p 1313:1313 $(DOCKER_IMG) $(SERVE_CMD) production-build: clean + @./check_hugo.sh hugo \ --minify preview-build: clean + @./check_hugo.sh hugo \ --baseURL $(DEPLOY_PRIME_URL) \ --buildDrafts \ diff --git a/check_hugo.sh b/check_hugo.sh new file mode 100755 index 0000000..0391326 --- /dev/null +++ b/check_hugo.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +command -v hugo >/dev/null || (echo "Hugo extended must be installed on your system." >/dev/stderr; exit 1) +hugo version | grep -i extended >/dev/null || (echo "Your Hugo installation does not appear to be extended." >/dev/stderr; exit 1)