Subject: Simplifying template precedence.

From: "Cody A.W. Somerville" <[email-masked]>
Date: Fri, 19 Jun 2009 08:17:51 +0200

---
 functions/templates.sh | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/functions/templates.sh b/functions/templates.sh
index 846034b..eec52f3 100755
--- a/functions/templates.sh
+++ b/functions/templates.sh
@@ -11,23 +11,14 @@ Check_templates ()
 {
 	PACKAGE="${1}"
 
-	# Check user defined templates directory
-	if [ ! -e "${LH_TEMPLATES}" ]
+	if [ -d "config/templates/${PACKAGE}" ]
 	then
-		if [ -d config/templates ]
-		then
-			LH_TEMPLATES=config/templates
-		else
-			Echo_error "templates not accessible in %s nor config/templates" "${LH_TEMPLATES}"
-			exit 1
-		fi
-	fi
-
-	if [ -d "${LH_TEMPLATES}/${PACKAGE}" ]
+		TEMPLATES="config/templates/${PACKAGE}"
+	elif [ -d "${LH_TEMPLATES}/${PACKAGE}" ]
 	then
 		TEMPLATES="${LH_TEMPLATES}/${PACKAGE}"
 	else
-		Echo_error "%s templates not accessible in %s" "${PACKAGE}" "${LH_TEMPLATES}"
+		Echo_error "%s templates not accessible in %s nor config/templates" "${PACKAGE}" "${LH_TEMPLATES}"
 		exit 1
 	fi
 }
-- 
cgit v1.0