@@ -76,38 +76,14 @@ export async function getDocUpdateStatus({
7676 const chunks = needsChunking ( sourceContent )
7777 ? splitIntoChunks ( sourceContent ) . length
7878 : 1 ;
79- const sourceParsed = matter ( sourceContent ) ;
80-
81- let sourceLastModifiedDate = getLastModifiedTimeFromGit ( sourcePath ) ;
82- if ( sourceParsed . data . ref ) {
83- try {
84- await fs$ . access ( sourceParsed . data . ref ) ;
85- } catch ( error ) {
86- logger . error (
87- `Referenced file not found: ${ sourceParsed . data . ref } , don't need updating, consider REMOVING it` ,
88- ) ;
89- return {
90- shouldUpdate : false ,
91- reason : 'Referenced file not found' ,
92- chunks,
93- } ;
94- }
95-
96- const refLastModifiedDate = getLastModifiedTimeFromGit (
97- sourceParsed . data . ref ,
98- ) ;
99- if ( refLastModifiedDate > sourceLastModifiedDate ) {
100- sourceLastModifiedDate = refLastModifiedDate ;
101- }
102- }
10379
10480 try {
10581 await fs$ . access ( targetPath ) ;
10682 } catch ( error ) {
10783 logger . debug ( `Target file not found: ${ targetPath } , needs updating` ) ;
10884 return { shouldUpdate : true , reason : 'Target not found.' , chunks } ;
10985 }
110-
86+ const sourceLastModifiedDate = getLastModifiedTimeFromGit ( sourcePath ) ;
11187 // Read target file and parse frontmatter
11288 const targetContent = await fs$ . readFile ( targetPath , 'utf8' ) ;
11389 const targetParsed = matter ( targetContent ) ;
@@ -126,13 +102,13 @@ export async function getDocUpdateStatus({
126102 ) ;
127103 return {
128104 shouldUpdate : true ,
129- reason : 'Source has been modified. ' ,
105+ reason : 'Source modified.' ,
130106 chunks,
131107 } ;
132108 }
133109 return {
134110 shouldUpdate : false ,
135- reason : 'Source has not been modified.' ,
111+ reason : 'Source not modified.' ,
136112 chunks,
137113 } ;
138114 }
@@ -143,7 +119,7 @@ export async function getDocUpdateStatus({
143119 ) ;
144120 return {
145121 shouldUpdate : true ,
146- reason : 'Target no source-updated-at metadata, needs updating .' ,
122+ reason : 'Target has no source-updated-at metadata.' ,
147123 chunks,
148124 } ;
149125}
0 commit comments