[keel] Make pack file copy logging nest for dir level

This commit is contained in:
Gary Talent 2024-09-14 02:52:38 -05:00
parent 71313ed8f4
commit b7990ed25b

View File

@ -135,8 +135,10 @@ static ox::Error transformClaw(
static ox::Error copy(
ox::FileSystem &src,
ox::FileSystem &dest,
ox::CRStringView path) noexcept {
oxOutf("copying directory: {}\n", path);
ox::CRStringView path,
ox::CRStringView logPrefix = "") noexcept {
oxOutf("{}copying directory: {}\n", logPrefix, path);
auto const childLogPrefix = ox::sfmt("{}\t", logPrefix);
// copy
oxRequire(fileList, src.ls(path));
for (auto const&name : fileList) {
@ -147,10 +149,10 @@ static ox::Error copy(
oxRequire(stat, src.stat(currentFile));
if (stat.fileType == ox::FileType::Directory) {
oxReturnError(dest.mkdir(currentFile, true));
oxReturnError(copy(src, dest, currentFile + '/'));
oxReturnError(copy(src, dest, currentFile + '/', childLogPrefix));
} else {
// load file
oxOutf("copying file: {}...", currentFile);
oxOutf("{}copying file: {}...", childLogPrefix, currentFile);
ox::StringView status = "failed";
oxDefer [&status] {
oxOutf(" {}\n", status);