Skip to content

Commit edebb41

Browse files
feat: add --no-readme flag to skip README updates
1 parent d102a4f commit edebb41

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ program
1616
.command("scan", { isDefault: true })
1717
.description("Scan stacks from multiple projects in public/stackscan/")
1818
.option("--color <mode>", "Color mode (brand, white, black, or hex)", "brand")
19+
.option("--no-readme", "Do not update the root README.md")
1920
.action(async (options) => {
2021
await scan(options);
2122
});

src/scan.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ function toCamelCase(str: string): string {
2525
interface SyncOptions {
2626
color?: string;
2727
copyAssets?: boolean;
28+
readme?: boolean; // commander uses --no-readme to set readme to false
2829
}
2930

3031
async function scan(options: SyncOptions = {}) {
32+
// Default readme to true if undefined
33+
if (options.readme === undefined) options.readme = true;
34+
3135
console.log('🚀 Starting Scan...');
3236
if (options.color) {
3337
console.log(`🎨 Color mode: ${options.color}`);
@@ -162,9 +166,11 @@ async function scan(options: SyncOptions = {}) {
162166
}
163167
}
164168

165-
// Update Root README
166-
if (allProjects.length > 0) {
169+
// Update Root README if enabled
170+
if (options.readme && allProjects.length > 0) {
167171
updateRootReadme(allProjects);
172+
} else if (!options.readme) {
173+
console.log('Skipping README update (--no-readme passed).');
168174
}
169175

170176
console.log('\n✨ Sync complete.');

0 commit comments

Comments
 (0)