Skip to content

Commit

Permalink
Reduce repeated code
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Aug 31, 2019
1 parent 05e36f1 commit 6c0626d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/rake/file_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,14 @@ def ruby(*args, &block)
# Attempt to do a normal file link, but fall back to a copy if the link
# fails.
def safe_ln(*args)
if !LN_SUPPORTED[0]
cp(*args)
else
if LN_SUPPORTED[0]
begin
ln(*args)
return ln(*args)
rescue StandardError, NotImplementedError
LN_SUPPORTED[0] = false
cp(*args)
end
end
cp(*args)
end

# Split a file path into individual directory names.
Expand Down

0 comments on commit 6c0626d

Please sign in to comment.