Method: FileUtils#safe_ln

Defined in:
lib/rake/file_utils.rb

#safe_ln(*args, **options) ⇒ Object

Attempt to do a normal file link, but fall back to a copy if the link

fails.


110
111
112
113
114
115
116
117
118
119
# File 'lib/rake/file_utils.rb', line 110

def safe_ln(*args, **options)
  if LN_SUPPORTED[0]
    begin
      return options.empty? ? ln(*args) : ln(*args, **options)
    rescue StandardError, NotImplementedError
      LN_SUPPORTED[0] = false
    end
  end
  options.empty? ? cp(*args) : cp(*args, **options)
end