summaryrefslogtreecommitdiff
path: root/functions/templates.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:15 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:26 +0100
commitc79ab34a7c597c9e3ab202c644121c6944789424 (patch)
tree324691f4f851c719b864229b399584f035b2873f /functions/templates.sh
parent0d5ff4ca7596790f853cf637e0fe225cad810a76 (diff)
downloadlive-build-c79ab34a7c597c9e3ab202c644121c6944789424.zip
live-build-c79ab34a7c597c9e3ab202c644121c6944789424.tar.gz
Adding live-helper 1.0~a19-1.
Diffstat (limited to 'functions/templates.sh')
-rwxr-xr-xfunctions/templates.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/functions/templates.sh b/functions/templates.sh
index 9fbc365..6b60c9e 100755
--- a/functions/templates.sh
+++ b/functions/templates.sh
@@ -11,22 +11,25 @@ set -e
Check_templates ()
{
- PROGRAM="${1}"
+ ITEM="${1}"
- # Check local templates
- if [ -d config/templates/"${PROGRAM}" ]
+ # Check user defined templates directory
+ if [ ! -d "${LIVE_TEMPLATES}" ]
then
- LIVE_TEMPLATES="config/templates"
+ if [ -d config/templates ]
+ then
+ LIVE_TEMPLATES=config/templates
+ else
+ Echo_error "templates not accessible in ${LIVE_TEMPLATES} nor config/templates"
+ exit 1
+ fi
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}" ]
+ if [ -d "${LIVE_TEMPLATES}/${ITEM}" ]
then
- Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}"
+ TEMPLATES="${LIVE_TEMPLATES}/${ITEM}"
+ else
+ Echo_error "${ITEM} templates not accessible in ${LIVE_TEMPLATES}"
exit 1
fi
}