From 71efba587e2e67ca7e681508ab82bf0ea4a3c4c3 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Fri, 3 Mar 2023 17:04:14 +0100 Subject: [PATCH] working on publish template command #5 --- src/var/lib/tyto/program/publish.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/var/lib/tyto/program/publish.py b/src/var/lib/tyto/program/publish.py index e5407a8..e6887d1 100644 --- a/src/var/lib/tyto/program/publish.py +++ b/src/var/lib/tyto/program/publish.py @@ -162,9 +162,14 @@ def create_template(option): item_src = '%s%s'%(db.srv_wip_tpl, item) item_dst = '%s%s'%(db.srv_www_tpl, item) - if shutil.copy2(item_src, item_dst): + if os.path.isdir(item_src): + shutil.copytree(item_src, item_dst) + print(' ├ Create dir :', item_dst) + else: + shutil.copy2(item_src, item_dst) print(' ├ Create file:', item_dst) + #================================# # Publish template in www server # #--------------------------------#