feat(api): add showDryRunPreview function

claude/api-code-samples-plan-MEkQO
Jason Stirnaman 2026-02-18 19:49:24 -06:00
parent 33705b85b5
commit 70e9f18497
1 changed files with 30 additions and 0 deletions

View File

@ -251,6 +251,36 @@ function cleanProductOutputs(productKey: string, config: ProductConfig): void {
}
}
/**
* Display dry-run preview of what would be cleaned
*
* @param productKey - Product identifier
* @param config - Product configuration
*/
function showDryRunPreview(productKey: string, config: ProductConfig): void {
const { directories, files } = getCleanupPaths(productKey, config);
console.log(`\nDRY RUN: Would clean the following for ${productKey}:\n`);
if (directories.length > 0) {
console.log('Directories to remove:');
directories.forEach((dir) => console.log(` - ${dir}`));
}
if (files.length > 0) {
console.log('\nFiles to remove:');
files.forEach((file) => console.log(` - ${file}`));
}
if (directories.length === 0 && files.length === 0) {
console.log(' (no files to clean)');
}
console.log(
`\nSummary: ${directories.length} directories, ${files.length} files would be removed`
);
}
/**
* Generate Hugo data files from OpenAPI specification
*