Mercurial > piecrust2
diff piecrust/commands/builtin/admin.py @ 653:466bbddd121e
admin: Run the asset pipeline before showing the admin panel.
* This makes the compiled assets available for the site preview.
* Remove unneeded `--foodtruck` option to `bake`.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 18 Feb 2016 20:54:37 -0800 |
parents | 59968ee07a07 |
children | dba53f0f7671 |
line wrap: on
line diff
--- a/piecrust/commands/builtin/admin.py Tue Feb 16 22:32:58 2016 -0800 +++ b/piecrust/commands/builtin/admin.py Thu Feb 18 20:54:37 2016 -0800 @@ -1,5 +1,6 @@ import os import logging +from piecrust import CACHE_DIR from piecrust.commands.base import ChefCommand @@ -47,6 +48,12 @@ return ctx.args.sub_func(ctx) def _runFoodTruck(self, ctx): + from piecrust.processing.pipeline import ProcessorPipeline + out_dir = os.path.join( + ctx.app.root_dir, CACHE_DIR, 'foodtruck', 'server') + proc = ProcessorPipeline(ctx.app, out_dir) + proc.run() + from foodtruck import settings settings.FOODTRUCK_CMDLINE_MODE = True settings.FOODTRUCK_ROOT = ctx.app.root_dir