Добавлена возможность проверки размера репозитория со снимками
This commit is contained in:
parent
31211516cb
commit
795fb0bdc4
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue