summaryrefslogtreecommitdiff
path: root/functions/templates.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:13 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:25 +0100
commitcd5110f6b8eb77519d704972276cfd5be6bff055 (patch)
tree3bc1bcdbff4ec3bd5a82ae34d9efed47b157e3e0 /functions/templates.sh
parentfdef63e60c2e68226da2fe92d6cc393c1af2b801 (diff)
downloadlive-build-cd5110f6b8eb77519d704972276cfd5be6bff055.zip
live-build-cd5110f6b8eb77519d704972276cfd5be6bff055.tar.gz
Adding live-helper 1.0~a17-1.
Diffstat (limited to 'functions/templates.sh')
-rwxr-xr-xfunctions/templates.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/functions/templates.sh b/functions/templates.sh
new file mode 100755
index 0000000..927c39f
--- /dev/null
+++ b/functions/templates.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# templates.sh - handle templates files
+# Copyright (C) 2007 Otavio Salvador <otavio@debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+Check_templates ()
+{
+ PROGRAM="${1}"
+
+ # Check local templates
+ if [ -d config/templates/"${PROGRAM}" ]
+ then
+ LIVE_TEMPLATES="config/templates"
+ fi
+
+ # Checking user templates
+ if [ ! -d "${LIVE_TEMPLATES}" ]
+ then
+ Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
+ exit 1
+ elif [ ! -d "${LIVE_TEMPLATES}/${PROGRAM}" ]
+ then
+ Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}"
+ exit 1
+ fi
+}