@@ -15,40 +15,40 @@ export function updateTrackerStructure(
1515 trackerConfig : TrackerConfig ,
1616 cwd : string
1717) : boolean {
18- const { repo, branch = 'main' , forkRepo } = repoGroup ;
19- const trackerData = trackerConfig . repos [ repo ] ;
20-
18+ const { repo, branch = 'main' , forkRepo } = repoGroup
19+ const trackerData = trackerConfig . repos [ repo ]
20+
2121 // If no tracker data exists, create a new entry
2222 if ( ! trackerData ) {
23- logger . info ( `Creating new tracker entry for repository ${ repo } ` ) ;
24-
23+ logger . info ( `Creating new tracker entry for repository ${ repo } ` )
24+
2525 trackerConfig . repos [ repo ] = {
2626 branch,
2727 lastCommitHash : '' ,
2828 syncedAt : new Date ( ) . toISOString ( ) ,
2929 filePaths : repoGroup . files ,
3030 files : { } ,
31- ...( forkRepo ? { forkRepo } : { } )
32- } ;
31+ ...( forkRepo ? { forkRepo } : { } ) ,
32+ }
3333 } else {
3434 // Always update the tracker structure while preserving existing data
35- logger . info ( `Updating tracker structure for repository ${ repo } ` ) ;
36-
35+ logger . info ( `Updating tracker structure for repository ${ repo } ` )
36+
3737 // Generate the new structure
38- const newStructure = generateRepoStructure ( repoGroup , trackerData ) ;
39-
38+ const newStructure = generateRepoStructure ( repoGroup , trackerData )
39+
4040 // Preserve existing data but use the new structure
4141 trackerConfig . repos [ repo ] = {
4242 ...newStructure ,
4343 lastCommitHash : trackerData . lastCommitHash || '' ,
4444 syncedAt : new Date ( ) . toISOString ( ) ,
45- files : preserveFileData ( trackerData . files || { } , newStructure . filePaths )
46- } ;
45+ files : preserveFileData ( trackerData . files || { } , newStructure . filePaths ) ,
46+ }
4747 }
48-
48+
4949 // Always write the updated tracker config
50- writeTrackerConfig ( cwd , trackerConfig ) ;
51- return true ;
50+ writeTrackerConfig ( cwd , trackerConfig )
51+ return true
5252}
5353
5454/**
@@ -61,15 +61,15 @@ function generateRepoStructure(
6161 repoGroup : RepoGroup ,
6262 trackerData ?: RepoSyncData
6363) : Omit < RepoSyncData , 'lastCommitHash' | 'syncedAt' | 'files' > {
64- const { branch = 'main' , forkRepo } = repoGroup ;
65-
64+ const { branch = 'main' , forkRepo } = repoGroup
65+
6666 return {
6767 branch,
6868 filePaths : repoGroup . files ,
6969 ...( forkRepo ? { forkRepo } : { } ) ,
7070 // Include pullRequest if it exists in the tracker data
71- ...( trackerData ?. pullRequest ? { pullRequest : trackerData . pullRequest } : { } )
72- } ;
71+ ...( trackerData ?. pullRequest ? { pullRequest : trackerData . pullRequest } : { } ) ,
72+ }
7373}
7474
7575/**
@@ -83,25 +83,25 @@ function preserveFileData(
8383 newFilePaths : FetchFile [ ]
8484) : Record < string , FileSyncData > {
8585 // Start with existing files
86- const updatedFiles = { ...existingFiles } ;
87-
86+ const updatedFiles = { ...existingFiles }
87+
8888 // Ensure all new file paths have entries, even if empty
8989 for ( const filePath of newFilePaths ) {
90- const localPath = filePath . local ;
91-
90+ const localPath = filePath . local
91+
9292 // If this file doesn't exist in the tracker yet, create an empty entry
9393 if ( ! updatedFiles [ localPath ] ) {
9494 updatedFiles [ localPath ] = {
9595 hash : '' ,
9696 syncedAt : '' ,
97- relativeSourcePath : filePath . source
98- } ;
99- }
97+ relativeSourcePath : filePath . source ,
98+ }
99+ }
100100 // If it exists but doesn't have relativeSourcePath, add it
101101 else if ( ! updatedFiles [ localPath ] . relativeSourcePath ) {
102- updatedFiles [ localPath ] . relativeSourcePath = filePath . source ;
102+ updatedFiles [ localPath ] . relativeSourcePath = filePath . source
103103 }
104104 }
105-
106- return updatedFiles ;
105+
106+ return updatedFiles
107107}
0 commit comments