Skip to content

Commit

Permalink
Refactor build_exe method to inline dlls variable logic
Browse files Browse the repository at this point in the history
- Inline the logic of the dlls variable directly into the build_exe method.
- Replace dlls variable with a direct call to Ocran.detect_dlls.
- Each block within the autodll section remains unchanged.
- This refactoring simplifies the code by removing the intermediate dlls variable.
  • Loading branch information
shinokaro committed Jun 2, 2024
1 parent cdf6718 commit 110debd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,6 @@ EOF
end
end

# Detect additional DLLs
dlls = Ocran.autodll ? Ocran.detect_dlls : []

Ocran.msg "Building #{Ocran.output_executable}"
target_script = nil
direction = proc do |sb|
Expand Down Expand Up @@ -784,12 +781,14 @@ EOF
end

# Add detected DLLs
dlls.each do |dll|
Ocran.msg "Adding detected DLL #{dll}"
if dll.subpath?(exec_prefix)
sb.create_file(dll, dll.relative_path_from(exec_prefix))
else
sb.create_file(dll, BINDIR / File.basename(dll))
if Ocran.autodll
Ocran.detect_dlls.each do |dll|
Ocran.msg "Adding detected DLL #{dll}"
if dll.subpath?(exec_prefix)
sb.create_file(dll, dll.relative_path_from(exec_prefix))
else
sb.create_file(dll, BINDIR / File.basename(dll))
end
end
end

Expand Down

0 comments on commit 110debd

Please sign in to comment.