Class: Hbc::Artifact::Binary

Inherits:
Symlinked show all
Defined in:
Library/Homebrew/cask/lib/hbc/artifact/binary.rb

Instance Attribute Summary

Attributes inherited from Relocated

#source, #target

Attributes inherited from AbstractArtifact

#cask, #config

Instance Method Summary collapse

Methods inherited from Symlinked

english_description, #install_phase, link_type_english_name, #summarize_installed, #uninstall_phase

Methods inherited from Relocated

from_args, #initialize, #resolve_target, #summarize, #to_a

Methods inherited from AbstractArtifact

#<=>, dirmethod, dsl_key, english_article, english_name, #initialize, read_script_arguments, #to_s

Methods included from Predicable

#attr_predicate

Constructor Details

This class inherits a constructor from Hbc::Artifact::Relocated

Instance Method Details



6
7
8
9
10
11
12
13
14
# File 'Library/Homebrew/cask/lib/hbc/artifact/binary.rb', line 6

def link(command: nil, **options)
  super(command: command, **options)
  return if source.executable?
  if source.writable?
    FileUtils.chmod "+x", source
  else
    command.run!("/bin/chmod", args: ["+x", source], sudo: true)
  end
end