@@ -8,7 +8,9 @@ const program = new Command()
88
99program
1010 . name ( 'social-preview' )
11- . description ( 'Generate branded social preview images for CodingWithCalvin repositories' )
11+ . description (
12+ 'Generate branded social preview images for CodingWithCalvin repositories'
13+ )
1214 . version ( '1.0.0' )
1315
1416program
@@ -18,12 +20,17 @@ program
1820 . argument ( '<repo>' , 'Repository name' )
1921 . option ( '-t, --token <token>' , 'GitHub token (or use GITHUB_TOKEN env var)' )
2022 . option ( '-d, --dry-run' , 'Generate image locally without uploading' , false )
21- . option ( '-o, --output <path>' , 'Output path for dry-run (default: <repo>.png)' )
23+ . option (
24+ '-o, --output <path>' ,
25+ 'Output path for dry-run (default: <repo>.png)'
26+ )
2227 . action ( async ( owner : string , repo : string , options ) => {
2328 const token = options . token || process . env . GITHUB_TOKEN
2429
2530 if ( ! token && ! options . dryRun ) {
26- console . error ( 'Error: GitHub token required. Use --token or set GITHUB_TOKEN env var.' )
31+ console . error (
32+ 'Error: GitHub token required. Use --token or set GITHUB_TOKEN env var.'
33+ )
2734 process . exit ( 1 )
2835 }
2936
@@ -54,16 +61,23 @@ program
5461
5562program
5663 . command ( 'generate-all' )
57- . description ( 'Generate and upload social previews for all repositories in an org' )
64+ . description (
65+ 'Generate and upload social previews for all repositories in an org'
66+ )
5867 . argument ( '<owner>' , 'Organization or user name' )
5968 . option ( '-t, --token <token>' , 'GitHub token (or use GITHUB_TOKEN env var)' )
6069 . option ( '-d, --dry-run' , 'Generate images locally without uploading' , false )
61- . option ( '-o, --output-dir <dir>' , 'Output directory for dry-run (default: ./previews)' )
70+ . option (
71+ '-o, --output-dir <dir>' ,
72+ 'Output directory for dry-run (default: ./previews)'
73+ )
6274 . action ( async ( owner : string , options ) => {
6375 const token = options . token || process . env . GITHUB_TOKEN
6476
6577 if ( ! token ) {
66- console . error ( 'Error: GitHub token required. Use --token or set GITHUB_TOKEN env var.' )
78+ console . error (
79+ 'Error: GitHub token required. Use --token or set GITHUB_TOKEN env var.'
80+ )
6781 process . exit ( 1 )
6882 }
6983
@@ -96,12 +110,16 @@ program
96110 }
97111 successCount ++
98112 } catch ( error ) {
99- console . error ( ` Error: ${ error instanceof Error ? error . message : error } ` )
113+ console . error (
114+ ` Error: ${ error instanceof Error ? error . message : error } `
115+ )
100116 errorCount ++
101117 }
102118 }
103119
104- console . log ( `\nCompleted: ${ successCount } successful, ${ errorCount } failed` )
120+ console . log (
121+ `\nCompleted: ${ successCount } successful, ${ errorCount } failed`
122+ )
105123
106124 if ( errorCount > 0 ) {
107125 process . exit ( 1 )
0 commit comments