build: suggestions from @MikeMcQuaid
Signed-off-by: botantony <antonsm21@gmail.com> Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
b2539d37fe
commit
6d548f784b
@ -232,12 +232,13 @@ class Build
|
|||||||
formula.linked_keg.resolved_path
|
formula.linked_keg.resolved_path
|
||||||
elsif formula.prefix.directory?
|
elsif formula.prefix.directory?
|
||||||
formula.prefix
|
formula.prefix
|
||||||
elsif (kids = formula.rack.children).size == 1 && T.must(kids.first).directory?
|
elsif (children = formula.rack.children.presence) && children.size == 1 &&
|
||||||
kids.first
|
(first_child = children.first.presence) && first_child.directory?
|
||||||
|
first_child
|
||||||
else
|
else
|
||||||
raise
|
raise
|
||||||
end
|
end
|
||||||
Keg.new(T.must(path)).optlink(verbose: args.verbose?)
|
Keg.new(path).optlink(verbose: args.verbose?)
|
||||||
rescue
|
rescue
|
||||||
raise "#{formula.opt_prefix} not present or broken\nPlease reinstall #{formula.full_name}. Sorry :("
|
raise "#{formula.opt_prefix} not present or broken\nPlease reinstall #{formula.full_name}. Sorry :("
|
||||||
end
|
end
|
||||||
@ -262,9 +263,9 @@ begin
|
|||||||
|
|
||||||
trap("INT", old_trap)
|
trap("INT", old_trap)
|
||||||
|
|
||||||
formula = args.named.to_formulae.first
|
formula = args.named.to_formulae.fetch(0)
|
||||||
options = Options.create(args.flags_only)
|
options = Options.create(args.flags_only)
|
||||||
build = Build.new(T.must(formula), options, args:)
|
build = Build.new(formula, options, args:)
|
||||||
|
|
||||||
build.install
|
build.install
|
||||||
# Any exception means the build did not complete.
|
# Any exception means the build did not complete.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user