Exception: Keg::ConflictError

Inherits:
LinkError
  • Object
show all
Defined in:
brew/Library/Homebrew/keg.rb

Instance Attribute Summary

Attributes inherited from LinkError

#dst, #keg, #src

Instance Method Summary collapse

Methods inherited from LinkError

#initialize

Constructor Details

This class inherits a constructor from Keg::LinkError

Instance Method Details

#suggestionObject



32
33
34
35
36
37
38
39
40
41
# File 'brew/Library/Homebrew/keg.rb', line 32

def suggestion
  conflict = Keg.for(dst)
rescue NotAKegError, Errno::ENOENT
  "already exists. You may want to remove it:\n  rm '#{dst}'\n"
else
  <<~EOS
    is a symlink belonging to #{conflict.name}. You can unlink it:
      brew unlink #{conflict.name}
  EOS
end

#to_sObject



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'brew/Library/Homebrew/keg.rb', line 43

def to_s
  s = []
  s << "Could not symlink #{src}"
  s << "Target #{dst}" << suggestion
  s << <<~EOS
    To force the link and overwrite all conflicting files:
      brew link --overwrite #{keg.name}

    To list all files that would be deleted:
      brew link --overwrite --dry-run #{keg.name}
  EOS
  s.join("\n")
end