Skip to content

Commit

Permalink
Simplify target generation by assuming file is always a subpath of sr…
Browse files Browse the repository at this point in the history
…c_prefix

Files in the loop are always relative paths and are converted to subdirectories of src_prefix, making conditional target generation unnecessary.
  • Loading branch information
shinokaro committed Jun 7, 2024
1 parent e77c74a commit e135737
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,7 @@ EOF
Ocran.msg "Adding user-supplied source files"
Ocran.files.each do |file|
file = src_prefix / file
if file.subpath?(exec_prefix)
target = file.relative_path_from(exec_prefix)
elsif file.subpath?(src_prefix)
target = SRCDIR / file.relative_path_from(src_prefix)
else
target = SRCDIR / file.basename
end

target = SRCDIR / file.relative_path_from(src_prefix)
target_script ||= target

if file.directory?
Expand Down

0 comments on commit e135737

Please sign in to comment.