@@ -369,9 +369,14 @@ def add_parser(subparsers, *args, **kwargs):
369
369
370
370
parser_clean_recipe_build = add_parser (subparsers ,
371
371
'clean_recipe_build' , aliases = ['clean-recipe-build' ],
372
- help = 'Delete the build info for the given recipe' ,
372
+ help = ('Delete the build components of the given recipe. '
373
+ 'By default this will also delete built dists' ),
373
374
parents = [generic_parser ])
374
375
parser_clean_recipe_build .add_argument ('recipe' , help = 'The recipe name' )
376
+ parser_clean_recipe_build .add_argument ('--no-clean-dists' , default = False ,
377
+ dest = 'no_clean_dists' ,
378
+ action = 'store_true' ,
379
+ help = 'If passed, do not delete existing dists' )
375
380
376
381
parser_clean_download_cache = add_parser (subparsers ,
377
382
'clean_download_cache' , aliases = ['clean-download-cache' ],
@@ -592,6 +597,8 @@ def clean_recipe_build(self, args):
592
597
recipe = Recipe .get_recipe (args .recipe , self .ctx )
593
598
info ('Cleaning build for {} recipe.' .format (recipe .name ))
594
599
recipe .clean_build ()
600
+ if not args .no_clean_dists :
601
+ self .clean_dists (args )
595
602
596
603
def clean_download_cache (self , args ):
597
604
'''
0 commit comments