Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2cea08
commit b52ee90
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# encoding: utf-8 | ||
|
||
import os | ||
|
||
import click | ||
|
||
from ckan.cli import minify, less, translation | ||
import ckan.plugins.toolkit as toolkit | ||
|
||
|
||
@click.group( | ||
name=u"front-end-build", | ||
short_help=u"Creates and minifies css and JavaScript files.", | ||
invoke_without_command=True, | ||
) | ||
@click.pass_context | ||
def front_end_build(ctx): | ||
if ctx.invoked_subcommand is None: | ||
ctx.invoke(build) | ||
|
||
|
||
@front_end_build.command(short_help=u"Compile css and js.",) | ||
@click.pass_context | ||
def build(ctx): | ||
ctx.invoke(less.less) | ||
ctx.invoke(translation.js) | ||
|
||
# minification | ||
public = toolkit.config.get(u"ckan.base_public_folder") | ||
root = os.path.join(os.path.dirname(__file__), u"..", public, u"base") | ||
root = os.path.abspath(root) | ||
ckanext = os.path.join(os.path.dirname(__file__), u"..", u"..", u"ckanext") | ||
ckanext = os.path.abspath(ckanext) | ||
cmd = ctx.invoke(minify.minify, path=(root, ckanext)) |