# HG changeset patch # User Ludovic Chabant # Date 1455857677 28800 # Node ID 466bbddd121efdd3f83c4d56a702ddde67f45be9 # Parent 41e9714e3a5f4b7f0354acaf32ff8b9d3727dae9 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`. diff -r 41e9714e3a5f -r 466bbddd121e piecrust/commands/builtin/admin.py --- 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 diff -r 41e9714e3a5f -r 466bbddd121e piecrust/commands/builtin/baking.py --- a/piecrust/commands/builtin/baking.py Tue Feb 16 22:32:58 2016 -0800 +++ b/piecrust/commands/builtin/baking.py Thu Feb 18 20:54:37 2016 -0800 @@ -58,24 +58,8 @@ '--show-timers', help="Show detailed timing information.", action='store_true') - parser.add_argument( - '--foodtruck', - help="Run the asset pipeline for FoodTruck.", - action='store_true') def run(self, ctx): - if ctx.args.foodtruck: - if ctx.args.html_only: - raise Exception("`--foodtruck` and `--html-only` can't be " - "both specified.") - if ctx.args.output: - raise Exception("`--foodtruck` and `--output` can't be " - "both specified.") - - ctx.args.assets_only = True - ctx.args.output = os.path.join(ctx.app.root_dir, CACHE_DIR, - 'foodtruck', 'server') - out_dir = (ctx.args.output or os.path.join(ctx.app.root_dir, '_counter'))