Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions cookbook/src/commands/regenerate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {execSync} from 'child_process';
import {CommandModule} from 'yargs';
import {applyRecipe} from '../lib/apply';
import {FILES_TO_IGNORE_FOR_GENERATE, TEMPLATE_PATH} from '../lib/constants';
import {withResolvedCatalog} from '../lib/workspace';
import {generateRecipe} from '../lib/generate';
import {isRenderFormat, RENDER_FORMATS, renderRecipe} from '../lib/render';
import {listRecipes, separator, RecipeManifestFormat} from '../lib/util';
Expand Down Expand Up @@ -71,24 +70,19 @@ async function handler(args: RegenerateArgs) {

for await (const recipe of recipes) {
console.log(`🔄 Regenerating recipe '${recipe}'`);
// resolve catalog/workspace protocols, apply recipe, then restore
await withResolvedCatalog(async () => {
applyRecipe({
recipeTitle: recipe,
});
// generate the recipe
await generateRecipe({
recipeName: recipe,
onlyFiles: args.onlyFiles,
filenamesToIgnore: FILES_TO_IGNORE_FOR_GENERATE,
referenceBranch: args.referenceBranch,
recipeManifestFormat: args.recipeManifestFormat,
});
// render the recipe
renderRecipe({
recipeName: recipe,
format,
});
applyRecipe({
recipeTitle: recipe,
});
await generateRecipe({
recipeName: recipe,
onlyFiles: args.onlyFiles,
filenamesToIgnore: FILES_TO_IGNORE_FOR_GENERATE,
referenceBranch: args.referenceBranch,
recipeManifestFormat: args.recipeManifestFormat,
});
renderRecipe({
recipeName: recipe,
format,
});
// clean up the skeleton template directory
execSync(`git checkout -- ${TEMPLATE_PATH}`);
Expand Down
Loading