Rebuild if command line argument is set

This commit is contained in:
Woody 2024-01-07 22:06:20 +01:00
parent 0a9145cd3c
commit 21de9e938a
No known key found for this signature in database
GPG Key ID: 9872D7F5072789B2

View File

@ -44,6 +44,10 @@ function saveCache(file) {
}
function isCached(file) {
// If command line argument is set, always rebuild
if (process.argv[2] == "--force" || process.argv[2] == "-f") {
return false;
}
const stat = fs.statSync(file);
const cached = cache[file];
if (cached && cached.mtime >= stat.mtimeMs && cached.size == stat.size) {