aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlex2016-09-21 08:33:10 -0700
committerGitHub2016-09-21 08:33:10 -0700
commitd282565bd08bacf5aa03418e26d3fe9e7b0869cb (patch)
tree3ec0833debc11c929fcf80ab1e445b9fe2cb17a9 /Library
parent169a07990372c1d3217db0a45b9457ae58edb4f5 (diff)
downloadbrew-d282565bd08bacf5aa03418e26d3fe9e7b0869cb.tar.bz2
Improved accessibility access conditional style
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index 7037a5694..7c1006b8a 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -225,12 +225,7 @@ class Hbc::Installer
def enable_accessibility_access
return unless @cask.accessibility_access
ohai "Enabling accessibility access"
- if MacOS.version >= :sierra
- opoo <<-EOS.undent
- Accessibility access cannot be enabled automatically on this version of macOS.
- See System Preferences to enable it manually.
- EOS
- elsif MacOS.version <= :mountain_lion
+ if MacOS.version <= :mountain_lion
@command.run!("/usr/bin/touch",
args: [Hbc.pre_mavericks_accessibility_dotfile],
sudo: true)
@@ -241,24 +236,29 @@ class Hbc::Installer
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);",
],
sudo: true)
- else
+ elsif MacOS.version <= :el_capitan
@command.run!("/usr/bin/sqlite3",
args: [
Hbc.tcc_db,
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);",
],
sudo: true)
+ else
+ opoo <<-EOS.undent
+ Accessibility access cannot be enabled automatically on this version of macOS.
+ See System Preferences to enable it manually.
+ EOS
end
end
def disable_accessibility_access
return unless @cask.accessibility_access
- if MacOS.version >= :sierra
+ if MacOS.version <= :mountain_lion
opoo <<-EOS.undent
- Accessibility access cannot be disabled automatically on this version of macOS.
- See System Preferences to disable it manually.
+ Accessibility access was enabled for #{@cask}, but it is not safe to disable
+ automatically on this version of macOS. See System Preferences.
EOS
- elsif MacOS.version >= :mavericks
+ elsif MacOS.version <= :el_capitan
ohai "Disabling accessibility access"
@command.run!("/usr/bin/sqlite3",
args: [
@@ -268,8 +268,8 @@ class Hbc::Installer
sudo: true)
else
opoo <<-EOS.undent
- Accessibility access was enabled for #{@cask}, but it is not safe to disable
- automatically on this version of macOS. See System Preferences.
+ Accessibility access cannot be disabled automatically on this version of macOS.
+ See System Preferences to disable it manually.
EOS
end
end