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, **) if LN_SUPPORTED[0] begin return .empty? ? ln(*args) : ln(*args, **) rescue StandardError, NotImplementedError LN_SUPPORTED[0] = false end end .empty? ? cp(*args) : cp(*args, **) end |