editor: explicit runtime path contract

This commit is contained in:
2026-04-28 14:49:41 +08:00
parent 0e506f21ec
commit cd166037bf
38 changed files with 210 additions and 129 deletions

View File

@@ -12,13 +12,11 @@ namespace {
std::filesystem::path ResolveBuildCaptureRoot(
const std::filesystem::path& requestedCaptureRoot,
const std::filesystem::path& executableDirectory) {
std::filesystem::path captureRoot = executableDirectory / "captures";
const std::filesystem::path scenarioPath = requestedCaptureRoot.parent_path().filename();
if (!scenarioPath.empty() && scenarioPath != "captures") {
captureRoot /= scenarioPath;
if (!requestedCaptureRoot.empty()) {
return requestedCaptureRoot.lexically_normal();
}
return captureRoot.lexically_normal();
return (executableDirectory / "captures").lexically_normal();
}
} // namespace