Library/Homebrew/cask/installer.rb
# TODO: logically could be in a separate class
logically could be in a separate class
logically could be in a separate class
def enable_accessibility_access
      return unless @cask.accessibility_access
      ohai "Enabling accessibility access"
      if MacOS.version <= :mountain_lion
        @command.run!(
          "/usr/bin/touch",
          args: [MacOS.pre_mavericks_accessibility_dotfile],
          sudo: true,
        )
      elsif MacOS.version <= :yosemite
        @command.run!(
          "/usr/bin/sqlite3",
          args: [
            MacOS.tcc_db,
            "INSERT OR REPLACE INTO access " \
            "VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);",
          ],
          sudo: true,
        )
      elsif MacOS.version <= :el_capitan
        @command.run!(
          "/usr/bin/sqlite3",
          args: [
            MacOS.tcc_db,
            "INSERT OR REPLACE INTO access " \
            "VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);",
          ],
          sudo: true,
        )
      else
        opoo <<~EOS
          Accessibility access cannot be enabled automatically on this version of macOS.
          See System Preferences to enable it manually.
        EOS
      end
    rescue => e
      purge_versioned_files
      raise e
    end
def enable_accessibility_access return unless @cask . accessibility_access ohai "Enabling accessibility access" if MacOS . version <= :mountain_lion @command . run! ( "/usr/bin/touch" , args : [ MacOS . pre_mavericks_accessibility_dotfile ] , sudo : true , ) elsif MacOS . version <= :yosemite @command . run! ( "/usr/bin/sqlite3" , args : [ MacOS . tcc_db , "INSERT OR REPLACE INTO access " "VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);" , ] , sudo : true , ) elsif MacOS . version <= :el_capitan @command . run! ( "/usr/bin/sqlite3" , args : [ MacOS . tcc_db , "INSERT OR REPLACE INTO access " "VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);" , ] , sudo : true , ) else opoo <<~EOS 
          Accessibility access cannot be enabled automatically on this version of macOS.
          See System Preferences to enable it manually.
         EOS end rescue => e purge_versioned_files raise e end
TODO: logically could be in a separate class
TODO : logically could be in a separate class