@@ -519,13 +519,16 @@ export class ScriptDownloaderService {
519519 comparisonPromises . push (
520520 this . compareSingleFile ( script , scriptPath , `${ finalTargetDir } /${ fileName } ` )
521521 . then ( result => {
522+ if ( result . error ) {
523+ console . error ( `[Comparison] Error comparing ${ result . filePath } : ${ result . error } ` ) ;
524+ }
522525 if ( result . hasDifferences ) {
523526 hasDifferences = true ;
524527 differences . push ( result . filePath ) ;
525528 }
526529 } )
527- . catch ( ( ) => {
528- // Don't add to differences if there's an error reading files
530+ . catch ( ( error ) => {
531+ console . error ( `[Comparison] Promise error for ${ scriptPath } :` , error ) ;
529532 } )
530533 ) ;
531534 }
@@ -541,13 +544,16 @@ export class ScriptDownloaderService {
541544 comparisonPromises . push (
542545 this . compareSingleFile ( script , installScriptPath , installScriptPath )
543546 . then ( result => {
547+ if ( result . error ) {
548+ console . error ( `[Comparison] Error comparing ${ result . filePath } : ${ result . error } ` ) ;
549+ }
544550 if ( result . hasDifferences ) {
545551 hasDifferences = true ;
546552 differences . push ( result . filePath ) ;
547553 }
548554 } )
549- . catch ( ( ) => {
550- // Don't add to differences if there's an error reading files
555+ . catch ( ( error ) => {
556+ console . error ( `[Comparison] Promise error for ${ installScriptPath } :` , error ) ;
551557 } )
552558 ) ;
553559 }
@@ -567,13 +573,16 @@ export class ScriptDownloaderService {
567573 comparisonPromises . push (
568574 this . compareSingleFile ( script , alpineInstallScriptPath , alpineInstallScriptPath )
569575 . then ( result => {
576+ if ( result . error ) {
577+ console . error ( `[Comparison] Error comparing ${ result . filePath } : ${ result . error } ` ) ;
578+ }
570579 if ( result . hasDifferences ) {
571580 hasDifferences = true ;
572581 differences . push ( result . filePath ) ;
573582 }
574583 } )
575- . catch ( ( ) => {
576- // Don't add to differences if there's an error reading files
584+ . catch ( ( error ) => {
585+ console . error ( `[Comparison] Promise error for ${ alpineInstallScriptPath } :` , error ) ;
577586 } )
578587 ) ;
579588 } catch {
@@ -584,10 +593,11 @@ export class ScriptDownloaderService {
584593 // Wait for all comparisons to complete
585594 await Promise . all ( comparisonPromises ) ;
586595
596+ console . log ( `[Comparison] Completed comparison for ${ script . slug } : hasDifferences=${ hasDifferences } , differences=${ differences . length } ` ) ;
587597 return { hasDifferences, differences } ;
588598 } catch ( error ) {
589- console . error ( ' Error comparing script content:' , error ) ;
590- return { hasDifferences : false , differences : [ ] } ;
599+ console . error ( `[Comparison] Error comparing script content for ${ script . slug } :` , error ) ;
600+ return { hasDifferences : false , differences : [ ] , error : error . message } ;
591601 }
592602 }
593603
@@ -597,27 +607,39 @@ export class ScriptDownloaderService {
597607 const repoUrl = this . getRepoUrlForScript ( script ) ;
598608 const branch = process . env . REPO_BRANCH || 'main' ;
599609
610+ console . log ( `[Comparison] Comparing ${ filePath } from ${ repoUrl } (branch: ${ branch } )` ) ;
611+
600612 // Read local content
601613 const localContent = await readFile ( localPath , 'utf-8' ) ;
614+ console . log ( `[Comparison] Local file size: ${ localContent . length } bytes` ) ;
602615
603616 // Download remote content from the script's repository
604617 const remoteContent = await this . downloadFileFromGitHub ( repoUrl , remotePath , branch ) ;
618+ console . log ( `[Comparison] Remote file size: ${ remoteContent . length } bytes` ) ;
605619
606620 // Apply modification only for CT scripts, not for other script types
607621 let modifiedRemoteContent ;
608622 if ( remotePath . startsWith ( 'ct/' ) ) {
609623 modifiedRemoteContent = this . modifyScriptContent ( remoteContent ) ;
624+ console . log ( `[Comparison] Applied CT script modifications` ) ;
610625 } else {
611626 modifiedRemoteContent = remoteContent ; // Don't modify tools or vm scripts
612627 }
613628
614629 // Compare content
615630 const hasDifferences = localContent !== modifiedRemoteContent ;
616631
632+ if ( hasDifferences ) {
633+ console . log ( `[Comparison] Differences found in ${ filePath } ` ) ;
634+ } else {
635+ console . log ( `[Comparison] No differences in ${ filePath } ` ) ;
636+ }
637+
617638 return { hasDifferences, filePath } ;
618639 } catch ( error ) {
619- console . error ( `Error comparing file ${ filePath } :` , error ) ;
620- return { hasDifferences : false , filePath } ;
640+ console . error ( `[Comparison] Error comparing file ${ filePath } :` , error . message ) ;
641+ // Return error information so it can be handled upstream
642+ return { hasDifferences : false , filePath, error : error . message } ;
621643 }
622644 }
623645
0 commit comments