From 9c2293a08e00e8c417df7a173b0aa13322352a59 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 20 Nov 2022 14:27:28 -0800 Subject: [PATCH] Move Sandbox check to extend/os --- Library/Homebrew/extend/os/mac/sandbox.rb | 9 +++++++++ Library/Homebrew/extend/os/sandbox.rb | 4 ++++ Library/Homebrew/sandbox.rb | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Library/Homebrew/extend/os/mac/sandbox.rb create mode 100644 Library/Homebrew/extend/os/sandbox.rb diff --git a/Library/Homebrew/extend/os/mac/sandbox.rb b/Library/Homebrew/extend/os/mac/sandbox.rb new file mode 100644 index 0000000000..976ede4716 --- /dev/null +++ b/Library/Homebrew/extend/os/mac/sandbox.rb @@ -0,0 +1,9 @@ +# typed: strict +# frozen_string_literal: true + +class Sandbox + sig { returns(T::Boolean) } + def self.available? + File.executable?(SANDBOX_EXEC) + end +end diff --git a/Library/Homebrew/extend/os/sandbox.rb b/Library/Homebrew/extend/os/sandbox.rb new file mode 100644 index 0000000000..f34ef2b4b2 --- /dev/null +++ b/Library/Homebrew/extend/os/sandbox.rb @@ -0,0 +1,4 @@ +# typed: strict +# frozen_string_literal: true + +require "extend/os/mac/sandbox" if OS.mac? diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index f601b801c5..6525a2f750 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -17,7 +17,7 @@ class Sandbox sig { returns(T::Boolean) } def self.available? - OS.mac? && File.executable?(SANDBOX_EXEC) + false end sig { void } @@ -256,3 +256,5 @@ class Sandbox end private_constant :SandboxProfile end + +require "extend/os/sandbox"