Skip to content

Commit

Permalink
fix: prefer param file in current path
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Jul 5, 2024
1 parent 846f84a commit 4940be1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/bzlws_tool_lib/bzlws_tool_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,17 @@ bzlws_tool_lib::options bzlws_tool_lib::parse_args

if(arg == "--params_file") {
auto param_file = next_arg();
if(!fs::exists(workspace_dir / param_file)) {
auto param_file_path fs::path{param_file};
if(!fs::exists(param_file_path)) {
param_file_path = workspace_dir / param_file_path;
}
if(!fs::exists(param_file_path)) {
std::cerr
<< "[ERROR] Unable to read params file: " << param_file << std::endl;
tool_exit(exit_code::filesystem_error);
}

std::ifstream param_file_stream(workspace_dir / param_file);
std::ifstream param_file_stream(param_file_path);

auto get_next_line = [&]{
std::string next_line;
Expand Down

0 comments on commit 4940be1

Please sign in to comment.