Skip to content

Commit df45dca

Browse files
authored
feat: better error output when running with bazel (#91)
1 parent b17ce9c commit df45dca

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ecsact/cli/commands/codegen/codegen_util.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,15 @@ auto ecsact::cli::resolve_plugin_path( //
9595
auto paths_checked_str = std::string{};
9696

9797
for(auto& checked_path : checked_plugin_paths) {
98-
paths_checked_str += std::format( //
99-
" - {}\n",
100-
fs::relative(checked_path).string()
101-
);
98+
auto checked_path_str = std::string{};
99+
if(std::getenv("BUILD_WORKSPACE_DIRECTORY") != nullptr) {
100+
// Easier to follow absolute paths in a bazel run/test environment
101+
checked_path_str = fs::absolute(checked_path).generic_string();
102+
} else {
103+
checked_path_str = fs::relative(checked_path).generic_string();
104+
}
105+
106+
paths_checked_str += std::format(" - {}\n", checked_path_str);
102107
}
103108
ecsact::cli::report_error(
104109
"Unable to find codegen plugin '{}'. Paths checked:\n{}",

0 commit comments

Comments
 (0)