Skip to content

Commit

Permalink
Move attempt_load_autoload call before post_env definition
Browse files Browse the repository at this point in the history
- Rearranged the order of operations to call attempt_load_autoload before
  defining post_env. This change ensures that all changes to the Ruby
  environment due to user script execution occur before the build process.
  • Loading branch information
shinokaro committed Jul 16, 2024
1 parent a6ac092 commit 1d00e9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ module Ocran
end

def Ocran.build_exe
post_env = RuntimeEnvironment.save

ENV.replace(@pre_env.env)

# If the script was run and autoload is enabled, attempt to autoload libraries.
if @option.force_autoload?
attempt_load_autoload(@ignore_modules)
end

post_env = RuntimeEnvironment.save

ENV.replace(@pre_env.env)

# Store the currently loaded files (before we require rbconfig for
# our own use).
features = $LOADED_FEATURES.map { |feature| Pathname(feature) }
Expand Down

0 comments on commit 1d00e9b

Please sign in to comment.