Files
news.gitea.happylizard.me/bin/gems/facets-3.1.0/lib/standard/facets/fileutils/safe_ln.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

28 lines
425 B
Ruby

require 'fileutils'
module FileUtils
module_function
LINKING_SUPPORTED = [true]
# Attempt to do a normal file link, but fall back
# to a copy if the link fails.
#
# CREDIT: Jim Weirich
def safe_ln(*args)
unless LINKING_SUPPORTED[0]
cp(*args)
else
begin
ln(*args)
rescue Errno::EOPNOTSUPP
LINKING_SUPPORTED[0] = false
cp(*args)
end
end
end
end