# HG changeset patch # User Ludovic Chabant # Date 1451515643 28800 # Node ID c7ac7dc2fe73d24d46ada0e036d0a9e66e0a9f50 # Parent 42a5e78e782a4a39a36e34e4413b74c554845360 bake: Add option to bake assets for FoodTruck. This is likely temporary. diff -r 42a5e78e782a -r c7ac7dc2fe73 piecrust/commands/builtin/baking.py --- a/piecrust/commands/builtin/baking.py Wed Dec 30 14:46:51 2015 -0800 +++ b/piecrust/commands/builtin/baking.py Wed Dec 30 14:47:23 2015 -0800 @@ -5,6 +5,7 @@ import fnmatch import datetime from colorama import Fore +from piecrust import CACHE_DIR from piecrust.baking.baker import Baker from piecrust.baking.records import ( BakeRecord, BakeRecordEntry, SubPageBakeInfo) @@ -57,8 +58,24 @@ '--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'))