Update to work with globby@10

With the globby v10 release, the shape of the file info object changed when requesting stats.

See https://github.com/mrmlnc/fast-glob#stats for details.
This commit is contained in:
Tim Schaub
2019-09-23 15:34:24 +02:00
parent e3d83598ad
commit 295c720645

View File

@@ -251,11 +251,11 @@ async function render(entries, options) {
}
async function getLatest(patterns) {
const stats = await globby(patterns, {stats: true});
const infoList = await globby(patterns, {stats: true});
let latest = 0;
for (const stat of stats) {
if (stat.mtime > latest) {
latest = stat.mtime;
for (const info of infoList) {
if (info.stats.mtime > latest) {
latest = info.stats.mtime;
}
}
return latest;