From d6d7cb22dce3b867e08d2e6d4557252205c47456 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 24 Aug 2018 16:41:30 +0000 Subject: [PATCH] Check mod.config format in the Makefile. --- .travis.yml | 1 + Makefile | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61ea43c..25b0b32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ addons: script: - make - . mod.config; + awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format: file must be saved using unix-style (CR, not CRLF) line endings.\n"; travis_terminate 1); if [ "${TRAVIS_TEST_MOD}" == "True" ]; then make test || travis_terminate 1; fi; if [ "${TRAVIS_TEST_PACKAGING}" == "True" ]; then ./packaging/package-all.sh test-0 || travis_terminate 1; fi diff --git a/Makefile b/Makefile index 4ecdb4b..2d566c5 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,11 @@ HAS_LUAC = $(shell command -v luac 2> /dev/null) LUA_FILES = $(shell find mods/*/maps/* -iname '*.lua') PROJECT_DIRS = $(shell dirname $$(find . -iname "*.csproj" -not -path "$(ENGINE_DIRECTORY)/*")) +scripts: + @awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format: file must be saved using unix-style (CR, not CRLF) line endings.\n"; exit 1) + variables: - @if [ -z "$(MOD_ID)" ] || [ -z "$(ENGINE_DIRECTORY)" ];then \ + @if [ -z "$(MOD_ID)" ] || [ -z "$(ENGINE_DIRECTORY)" ]; then \ echo "Required mod.config variables are missing:"; \ if [ -z "$(MOD_ID)" ]; then \ echo " MOD_ID"; \ @@ -47,7 +50,7 @@ variables: exit 1; \ fi -engine: variables +engine: variables scripts @./fetch-engine.sh || (printf "Unable to continue without engine files\n"; exit 1) @cd $(ENGINE_DIRECTORY) && make core