[studio/modlib] Make Project::mkdir only mkdir if dir does not exist
This commit is contained in:
parent
f9a14433d1
commit
5177cfb0e3
@ -56,9 +56,13 @@ ox::FileSystem &Project::romFs() noexcept {
|
||||
}
|
||||
|
||||
ox::Error Project::mkdir(ox::CRStringView path) const noexcept {
|
||||
oxReturnError(m_fs.mkdir(path, true));
|
||||
fileUpdated.emit(path, {});
|
||||
return {};
|
||||
auto const [stat, err] = m_fs.stat(path);
|
||||
if (err) {
|
||||
oxReturnError(m_fs.mkdir(path, true));
|
||||
fileUpdated.emit(path, {});
|
||||
}
|
||||
return stat.fileType == ox::FileType::Directory ?
|
||||
ox::Error{} : OxError(1, "path exists as normal file");
|
||||
}
|
||||
|
||||
ox::Result<ox::FileStat> Project::stat(ox::CRStringView path) const noexcept {
|
||||
|
Loading…
x
Reference in New Issue
Block a user