Module: Utils::Tool Private

Defined in:
utils/tool.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Invalidate selection when an executable fails its version check.

Class Method Summary collapse

Class Method Details

.invalidate_cache(tool) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



8
9
10
11
12
13
14
15
16
# File 'utils/tool.rb', line 8

def self.invalidate_cache(tool)
  return unless [:git, :curl, :svn].include?(tool)

  # Keep the cache location in sync with install_tool in utils/tool.sh.
  (HOMEBREW_CACHE/"tool-selection"/tool.to_s).unlink
rescue SystemCallError
  # Cache access must not replace the original error.
  nil
end