mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-02-01 09:18:40 +01:00
projects.mk / jw-projects.py: Support tmpl_dir && tmpls-dir
For a project to supply templates, it needs to advertise their location. For this, the tmpl_dir make variable is added to projects.mk. If other-project wants to get hold of some-project's templates, it can do, e.g.: TEMPLATES = $(wilcard $(call tmpl_dir,some-project)/*.tmpl) To achieve this, support for the tmpls-dir command is added to jw-projects.py. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
ca5910d423
commit
ced42938e1
3 changed files with 32 additions and 1 deletions
|
|
@ -115,7 +115,17 @@ class App(object):
|
|||
pd = self.proj_dir(name)
|
||||
if pd is None:
|
||||
return None
|
||||
for r in [ pd + "/tools/html/htdocs", pd + "/htdocs", "/srv/www/proj/" + name ]:
|
||||
for r in [ pd + "/src/html/htdocs", pd + "/tools/html/htdocs", pd + "/htdocs", "/srv/www/proj/" + name ]:
|
||||
if os.path.isdir(r):
|
||||
return r
|
||||
return None
|
||||
|
||||
# TODO: add support for customizing this in project.conf
|
||||
def tmpl_dir(self, name):
|
||||
pd = self.proj_dir(name)
|
||||
if pd is None:
|
||||
return None
|
||||
for r in [ pd + "/tmpl", "/opt/" + name + "/share/tmpl" ]:
|
||||
if os.path.isdir(r):
|
||||
return r
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue