Добавлена возможность проверки размера репозитория со снимками

This commit is contained in:
Alexander Zhirov 2025-05-29 16:23:10 +03:00
parent 31211516cb
commit 795fb0bdc4
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -442,4 +442,21 @@ class Snag {
writeln("Import completed successfully: ", newSnapshot);
}
void size() {
try {
"Total size of the snapshots is: %.2f MB".writefln(
dirEntries(_config.git, SpanMode.depth)
.filter!(path => path.isFile)
.array
.map!(path => path.getSize)
.sum / (1024.0 * 1024.0)
);
} catch (Exception e) {
throw new SnagException(
"Error while checking the snapshots size:\n\t"
~ e.msg
);
}
}
}