[olympic/studio] Make Project::writeObj only write descriptor if it does not already exist or if debug build
All checks were successful
Build / build (push) Successful in 2m9s
All checks were successful
Build / build (push) Successful in 2m9s
This commit is contained in:
parent
ae066a914c
commit
d3847caab4
@ -125,14 +125,20 @@ ox::Error Project::writeObj(ox::CRStringView path, T const&obj, ox::ClawFormat f
|
|||||||
}
|
}
|
||||||
// write out type store
|
// write out type store
|
||||||
auto const descPath = ox::sfmt("/{}/type_descriptors", m_projectDataDir);
|
auto const descPath = ox::sfmt("/{}/type_descriptors", m_projectDataDir);
|
||||||
oxReturnError(mkdir(descPath));
|
oxRequire(desc, m_typeStore.get<T>());
|
||||||
for (auto const&t : m_typeStore.typeList()) {
|
auto const descExists = m_fs.stat(ox::sfmt("{}/{}", descPath, buildTypeId(*desc))).error != 0;
|
||||||
oxRequireM(typeOut, ox::writeClaw(*t, ox::ClawFormat::Organic));
|
if (!descExists || ox::defines::Debug) {
|
||||||
// replace garbage last character with new line
|
// write all descriptors because we don't know which types T depends on
|
||||||
*typeOut.back().value = '\n';
|
oxReturnError(mkdir(descPath));
|
||||||
// write to FS
|
m_typeStore.get<T>().value;
|
||||||
auto const typePath = ox::sfmt("/{}/{}", descPath, buildTypeId(*t));
|
for (auto const &t: m_typeStore.typeList()) {
|
||||||
oxReturnError(writeBuff(typePath, typeOut));
|
oxRequireM(typeOut, ox::writeClaw(*t, ox::ClawFormat::Organic));
|
||||||
|
// replace garbage last character with new line
|
||||||
|
*typeOut.back().value = '\n';
|
||||||
|
// write to FS
|
||||||
|
auto const typePath = ox::sfmt("/{}/{}", descPath, buildTypeId(*t));
|
||||||
|
oxReturnError(writeBuff(typePath, typeOut));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
oxReturnError(keel::setAsset(m_ctx, path, obj));
|
oxReturnError(keel::setAsset(m_ctx, path, obj));
|
||||||
fileUpdated.emit(path);
|
fileUpdated.emit(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user