Skip to content

Commit

Permalink
Move build_complete variable and its logic to the place where its val…
Browse files Browse the repository at this point in the history
…ue is needed
  • Loading branch information
shinokaro committed Jun 4, 2024
1 parent 5f5f1b1 commit 7272c32
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 @@ -469,13 +469,6 @@ EOF
next
end

gem_extension = (gem_root / ".." / ".." / "extensions").expand_path
if gem_extension.exist?
build_complete = gem_extension.find.select { |pn| pn.file? && pn.basename.to_s == "gem.build_complete" && pn.dirname.basename.to_s == spec.full_name }
else
build_complete = nil
end

# Find the selected files
gem_root_files = unless (include & [:files, :extras, :scripts]).empty?
gem_root.find.select(&:file?)
Expand All @@ -488,8 +481,14 @@ EOF
features_from_gems.select { |feature| feature.subpath?(gem_root) }
when :files
selected_files = gem_root_files.select { |path| path.relative_path_from(gem_root).to_posix !~ GEM_NON_FILE_RE }
if build_complete
selected_files << build_complete
gem_extension = (gem_root / ".." / ".." / "extensions").expand_path
if gem_extension.exist?
build_complete = gem_extension.find.select do |pn|
pn.file? && pn.basename.to_s == "gem.build_complete" && pn.dirname.basename.to_s == spec.full_name
end
unless build_complete.empty?
selected_files << build_complete
end
end
selected_files
when :extras
Expand Down

0 comments on commit 7272c32

Please sign in to comment.