Changeset - 7ec976c8c198
[Not reviewed]
default
0 3 0
Mads Kiilerich (mads) - 7 years ago 2018-12-10 22:35:29
mads@kiilerich.com
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.
3 files changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
@@ -20,14 +20,14 @@ syntax: regexp
 
^\.settings$
 
^\.project$
 
^\.pydevproject$
 
^\.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$
 
^Kallithea\.egg-info$
 
^my\.ini$
 
^fabfile.py
kallithea/bin/kallithea_cli_front_end.py
Show inline comments
 
@@ -40,14 +40,18 @@ def front_end_build(install_deps, genera
 

	
 
    if install_deps:
 
        click.echo("Running 'npm install' to install front-end dependencies from package.json")
 
        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', '.code-highlight'],
 
                    stdout=f)
 
        lesscpath = os.path.join(front_end_dir, 'node_modules', '.bin', 'lessc')
kallithea/public/less/main.less
Show inline comments
 
@@ -10,13 +10,13 @@
 

	
 
/* 3rd party styles */
 
@import "node_modules/bootstrap/less/bootstrap.less";
 
@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 */
 
@import "kallithea-variables.less";
 
@import "kallithea-labels.less";
 
@import "yui-ac.less";
0 comments (0 inline, 0 general)