Module: Cask::Artifact::Installer::ScriptInstaller Private

Defined in:
cask/artifact/installer.rb,
cask/artifact/installer.rbi

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.

Extension module for script installers.

Instance Method Summary collapse

Instance Method Details

#install_phase(command: nil, **_) ⇒ Object

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.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'cask/artifact/installer.rb', line 28

def install_phase(command: nil, **_)
  # TODO: The `T.unsafe` is a false positive that is unnecessary in newer releasese of Sorbet
  # (confirmend with sorbet v0.5.10672)
  ohai "Running #{T.unsafe(self.class).dsl_key} script '#{path}'"

  executable_path = staged_path_join_executable(path)

  command.run!(
    executable_path,
    **args,
    env: { "PATH" => PATH.new(
      HOMEBREW_PREFIX/"bin", HOMEBREW_PREFIX/"sbin", ENV.fetch("PATH")
    ) },
  )
end