Updated cleaner to check for dir existing.
This commit is contained in:
parent
9156db7017
commit
b91e57669c
|
@ -13,6 +13,7 @@ import std.datetime;
|
||||||
const EXTRACTS_DIR = "extracts";
|
const EXTRACTS_DIR = "extracts";
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
if (!exists(EXTRACTS_DIR)) return 0;
|
||||||
immutable SysTime now = Clock.currTime();
|
immutable SysTime now = Clock.currTime();
|
||||||
foreach (DirEntry entry; dirEntries(EXTRACTS_DIR, SpanMode.shallow, false)) {
|
foreach (DirEntry entry; dirEntries(EXTRACTS_DIR, SpanMode.shallow, false)) {
|
||||||
Duration age = now - entry.timeLastModified();
|
Duration age = now - entry.timeLastModified();
|
||||||
|
|
Loading…
Reference in New Issue