summaryrefslogtreecommitdiff
path: root/tools/deploystatic/deploystatic.py
diff options
context:
space:
mode:
authorMagnus Hagander2017-08-15 17:28:48 +0000
committerMagnus Hagander2017-08-15 17:28:48 +0000
commit91d826fe484b7b3ee82923680fe2be39f66d0db7 (patch)
tree7aa9ce6b90545158eb3b23d56e145a0d27b68b08 /tools/deploystatic/deploystatic.py
parentb0dcc0172e56ed45ff73736bea7a8d2a472d7354 (diff)
Don't strip the templates/ prefix of target directory
It's actually used in the rendering code.
Diffstat (limited to 'tools/deploystatic/deploystatic.py')
-rwxr-xr-xtools/deploystatic/deploystatic.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/deploystatic/deploystatic.py b/tools/deploystatic/deploystatic.py
index ec683242..744567cd 100755
--- a/tools/deploystatic/deploystatic.py
+++ b/tools/deploystatic/deploystatic.py
@@ -245,16 +245,13 @@ if __name__ == "__main__":
for relpath, relname in source.walkfiles('templates'):
if relpath == 'templates/pages': continue
- # Remove templates/ prefix, since it will always be there
- destrelpath = relpath[len('templates/'):]
-
- if not os.path.isdir(os.path.join(args.destpath, destrelpath)):
- os.makedirs(os.path.join(args.destpath, destrelpath))
+ if not os.path.isdir(os.path.join(args.destpath, relpath)):
+ os.makedirs(os.path.join(args.destpath, relpath))
relsource = os.path.join(relpath, relname)
- source.copy_if_changed(relsource, os.path.join(args.destpath, destrelpath, relname))
+ source.copy_if_changed(relsource, os.path.join(args.destpath, relsource))
- knownfiles.append(os.path.join(destrelpath, relname))
+ knownfiles.append(relsource)
# Look for things to remove
for dn, subdirs, filenames in os.walk(args.destpath):