Skip to content

Commit

Permalink
chore: more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Aug 9, 2024
1 parent 21a9804 commit 942af6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ecsact/cli/commands/codegen/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ auto ecsact::cli::codegen(codegen_options options) -> int {
plugin_outputs_fn(package_id, filenames.data(), 16, 1024, nullptr);

for(auto i = 0; filenames_count > i; ++i) {
#if defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__
auto filename =
std::string_view{filenames[i], strnlen_s(filenames[i], 1023)};
#else
auto filename = std::string_view{filenames[i], strlen(filenames[i])};
#endif
plugin_output_paths.emplace_back(
fs::path{package_file_path}.parent_path() / filename
);
Expand All @@ -221,11 +225,9 @@ auto ecsact::cli::codegen(codegen_options options) -> int {
);
}

for(auto& output_file_path : plugin_output_paths) {
if(options.outdir) {
if(options.outdir) {
for(auto& output_file_path : plugin_output_paths) {
output_file_path = *options.outdir / output_file_path.filename();
} else {
output_file_path = output_file_path;
}
}

Expand Down Expand Up @@ -265,8 +267,6 @@ auto ecsact::cli::codegen(codegen_options options) -> int {

auto& file_write_stream = file_write_streams.emplace_back();
file_write_stream.open(output_file_path);

report_info("WRITING TO {}", fs::absolute(output_file_path).string());
}

plugin_fn(package_id, &file_write_fn, &codegen_report_fn);
Expand Down
1 change: 1 addition & 0 deletions ecsact/cli/commands/codegen/codegen.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <vector>
#include <filesystem>
#include <optional>
#include "ecsact/codegen/plugin.h"

namespace ecsact::cli {
Expand Down

0 comments on commit 942af6c

Please sign in to comment.