Skip to content

Commit 1d6c3f0

Browse files
authored
only check mtime of files, not dirs to determine release date (#10)
* only check mtime of files, not dirs to determine release date Ref: nodejs/build#1988
1 parent 333c71c commit 1d6c3f0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dist-indexer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,17 @@ function dirDate (dir, callback) {
366366
map(files, mtime, afterMap)
367367

368368
function mtime (file, callback) {
369+
const ignoreDirectoryDate = new Date('2019-10-01')
369370
fs.stat(path.join(argv.dist, dir, file), function (err, stat) {
370-
callback(null, stat && stat.mtime)
371+
if (err || !stat) {
372+
return callback(err)
373+
}
374+
if (!stat.isFile() && stat.mtime >= ignoreDirectoryDate) {
375+
// is a directory, but we stopped using directories as a date reference in Oct-19
376+
// and don't want to rewrite old dates
377+
return callback(null)
378+
}
379+
callback(null, stat.mtime) // is a file
371380
})
372381
}
373382

0 commit comments

Comments
 (0)