Ensure Hugo is properly installed

This commit is contained in:
Richard Belleville 2020-03-18 13:23:50 -07:00
parent a133f05ce5
commit 80b836138f
2 changed files with 9 additions and 0 deletions

View File

@ -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 \

6
check_hugo.sh Executable file
View File

@ -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)