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