diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-06 01:00:12 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-04-06 01:00:12 +0000 |
commit | d2209645ba26fc154b91c22def5d64519abf2c5a (patch) | |
tree | 392dadd7d52cc0bd8eef828e7e1a2bffe5e3dd8f /trunk | |
parent | ebd8d771f28310be1f4e77ce02dd657017e9b337 (diff) | |
download | simplepkg-d2209645ba26fc154b91c22def5d64519abf2c5a.tar.gz simplepkg-d2209645ba26fc154b91c22def5d64519abf2c5a.tar.bz2 |
templatepkg: --list improved
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@274 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk')
-rwxr-xr-x | trunk/src/templatepkg | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index 3b5c283..4521fef 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -526,20 +526,42 @@ function template_list { # list templates # usage: template_list [template_name] - local list + local list basedir template - # TODO: checar se ha / + if echo $1 | grep -q "/"; then - list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`" - if [ "$?" == "0" ]; then - list="`echo $list | xargs`" - echo "Default templates: $list" - fi + template="`echo $1 | cut -d "/" -f 1`" + + if [ -e "$BASE_CONF/defaults/templates/$1" ]; then + list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`" + if [ "$?" == "0" ]; then + list="`echo $list | xargs`" + echo "In the default template $template: $list" + fi + fi + + if [ -e "$BASE_CONF/templates/$1" ]; then + list="`ls $BASE_CONF/templates/$1 2> /dev/null`" + if [ "$?" == "0" ]; then + list="`echo $list | xargs`" + echo "In the custom template $template: $list" + fi + fi + + else + + list="`ls $BASE_CONF/defaults/templates/$1 2> /dev/null`" + if [ "$?" == "0" ]; then + list="`echo $list | xargs`" + echo "Default templates: $list" + fi + + list="`ls $BASE_CONF/templates/$1 2> /dev/null`" + if [ "$?" == "0" ]; then + list="`echo $list | xargs`" + echo "Custom templates: $list" + fi - list="`ls $BASE_CONF/templates/$1 2> /dev/null`" - if [ "$?" == "0" ]; then - list="`echo $list | xargs`" - echo "Custom templates: $list" fi } |