File tree Expand file tree Collapse file tree
packages/example-nextjs16 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,12 +18,17 @@ const ROOT = path.resolve(import.meta.dirname, '../..');
1818 * without a .git directory).
1919 */
2020function contentLastModified ( ) {
21- try {
22- const iso = execSync ( ' git log -1 --format=%cI' , {
21+ const gitDate = ( args ) =>
22+ execSync ( ` git log -1 --format=%cI ${ args } ` , {
2323 cwd : ROOT ,
2424 encoding : 'utf8' ,
2525 stdio : [ 'ignore' , 'pipe' , 'ignore' ] ,
2626 } ) . trim ( ) ;
27+ try {
28+ // Scoped to this package: a library release is not a change to any page
29+ // here, yet this date moved on every commit. HEAD stays the fallback for
30+ // a shallow clone, where a path-scoped log can find nothing.
31+ const iso = gitDate ( '-- packages/example-nextjs16' ) || gitDate ( '' ) ;
2732 if ( iso ) return new Date ( iso ) . toISOString ( ) ;
2833 } catch {
2934 // Not a git checkout — fall through.
You can’t perform that action at this time.
0 commit comments