[studio] Fix Project to cut off correct end of OC data
All checks were successful
Build / build (push) Successful in 2m31s

This commit is contained in:
Gary Talent 2024-09-28 21:10:13 -05:00
parent 2173b12c67
commit 945a55f94a

View File

@ -131,9 +131,12 @@ class Project {
template<typename T>
ox::Error Project::writeObj(ox::StringViewCR path, T const&obj, ox::ClawFormat fmt) noexcept {
oxRequireM(buff, ox::writeClaw(obj, fmt));
if (fmt == ox::ClawFormat::Organic) {
buff.pop_back();
}
// write to FS
oxReturnError(mkdir(parentDir(path)));
oxReturnError(writeBuff(path, ox::BufferView{buff} + (fmt == ox::ClawFormat::Organic)));
oxReturnError(writeBuff(path, buff));
// write type descriptor
if (m_typeStore.get<T>().error) {
oxReturnError(ox::buildTypeDef(m_typeStore, obj));