uptodate static method
Returns true if file
is newer than all depends
; otherwise false.
Implementation
static bool uptodate(String file, [List<String>? depends]) {
if (file.isEmpty) {
return false;
}
file = FilePath.expand(file);
final stat = FileStat.statSync(file);
if (stat.type == FileSystemEntityType.notFound) {
return false;
}
if (depends == null) {
return true;
}
final date = stat.modified;
for (final name in depends) {
final stat = FileStat.statSync(name);
if (stat.type == FileSystemEntityType.notFound) {
return false;
}
if (date.compareTo(stat.modified) < 0) {
return false;
}
}
return true;
}