Mercurial > kallithea
changeset 7460:7ec976c8c198
front-end: Store temporary files in a tmp directory
Avoid mixing temporary files with source files or have them in the generated
output. But for now, keep them in the front-end directory where we need write
access for node_modules anyway.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 10 Dec 2018 22:35:29 +0100 |
parents | 19a9f02443c8 |
children | 96b53ab02c2a |
files | .hgignore kallithea/bin/kallithea_cli_front_end.py kallithea/public/less/main.less |
diffstat | 3 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Tue Dec 04 12:16:20 2018 +0100 +++ b/.hgignore Mon Dec 10 22:35:29 2018 +0100 @@ -23,8 +23,8 @@ ^\.coverage$ ^kallithea/front-end/node_modules$ ^kallithea/front-end/package-lock\.json$ +^kallithea/front-end/tmp$ ^kallithea/public/css/style\.css(\.map)?$ -^kallithea/public/css/pygments.css$ ^theme\.less$ ^kallithea\.db$ ^test\.db$
--- a/kallithea/bin/kallithea_cli_front_end.py Tue Dec 04 12:16:20 2018 +0100 +++ b/kallithea/bin/kallithea_cli_front_end.py Mon Dec 10 22:35:29 2018 +0100 @@ -43,8 +43,12 @@ subprocess.check_call(['npm', 'install'], cwd=front_end_dir) if generate: + tmp_dir = os.path.join(front_end_dir, 'tmp') + if not os.path.isdir(tmp_dir): + os.mkdir(tmp_dir) + click.echo("Generating CSS") - with open(os.path.join(public_dir, 'pygments.css'), 'w') as f: + with open(os.path.join(tmp_dir, 'pygments.css'), 'w') as f: subprocess.check_call(['pygmentize', '-S', 'default', '-f', 'html',
--- a/kallithea/public/less/main.less Tue Dec 04 12:16:20 2018 +0100 +++ b/kallithea/public/less/main.less Mon Dec 10 22:35:29 2018 +0100 @@ -13,7 +13,7 @@ @import (inline) "3rd-party/dataTables.bootstrap.css"; @import (less) "../js/select2/select2.css"; @import (less) "../js/select2/select2-bootstrap.css"; -@import (less) "../css/pygments.css"; +@import (less) "tmp/pygments.css"; @import (less) "../fontello/css/kallithea.css"; /* kallithea styles */