simulate_system: fix tap_syntax
job errors
Fixes Error: Cannot simulate :ventura :intel while already simulating :macos. See https://github.com/Homebrew/homebrew-core/actions/runs/4974116510/jobs/8900390980#step:4:24.
This commit is contained in:
parent
6c80308290
commit
28c593ed6a
@ -19,10 +19,8 @@ module Homebrew
|
|||||||
def with(os: T.unsafe(nil), arch: T.unsafe(nil), &_block)
|
def with(os: T.unsafe(nil), arch: T.unsafe(nil), &_block)
|
||||||
raise ArgumentError, "At least one of `os` or `arch` must be specified." if !os && !arch
|
raise ArgumentError, "At least one of `os` or `arch` must be specified." if !os && !arch
|
||||||
|
|
||||||
if self.os || self.arch
|
old_os = self.os
|
||||||
raise "Cannot simulate#{os&.inspect&.prepend(" ")}#{arch&.inspect&.prepend(" ")} while already " \
|
old_arch = self.arch
|
||||||
"simulating#{self.os&.inspect&.prepend(" ")}#{self.arch&.inspect&.prepend(" ")}."
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
self.os = os if os
|
self.os = os if os
|
||||||
@ -30,7 +28,8 @@ module Homebrew
|
|||||||
|
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
clear
|
@os = old_os
|
||||||
|
@arch = old_arch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user