File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -339,10 +339,22 @@ function analyzeChanges() {
339339 stats . newTokens = addresses . length
340340 }
341341
342- // Check for new logo files
343- if ( fs . existsSync ( CONFIG . ASSETS_DIR ) ) {
344- const files = fs . readdirSync ( CONFIG . ASSETS_DIR )
345- stats . newLogos = files . length
342+ // Check for new logo files by counting only the newly added files
343+ try {
344+ const result = execSync ( 'git diff --cached --name-only --diff-filter=A' , {
345+ encoding : 'utf8' ,
346+ } )
347+ const newFiles = result
348+ . trim ( )
349+ . split ( '\n' )
350+ . filter ( ( file ) => file . startsWith ( CONFIG . ASSETS_DIR ) )
351+ stats . newLogos = newFiles . length
352+ } catch ( error ) {
353+ // Fallback: count all files in directory if git command fails
354+ if ( fs . existsSync ( CONFIG . ASSETS_DIR ) ) {
355+ const files = fs . readdirSync ( CONFIG . ASSETS_DIR )
356+ stats . newLogos = files . length
357+ }
346358 }
347359
348360 log ( `Analysis: ${ stats . newTokens } tokens, ${ stats . newLogos } logo files` )
You can’t perform that action at this time.
0 commit comments