Skip to content

Commit 6c0626d

Browse files
committed
Reduce repeated code
1 parent 05e36f1 commit 6c0626d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/rake/file_utils.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,14 @@ def ruby(*args, &block)
111111
# Attempt to do a normal file link, but fall back to a copy if the link
112112
# fails.
113113
def safe_ln(*args)
114-
if !LN_SUPPORTED[0]
115-
cp(*args)
116-
else
114+
if LN_SUPPORTED[0]
117115
begin
118-
ln(*args)
116+
return ln(*args)
119117
rescue StandardError, NotImplementedError
120118
LN_SUPPORTED[0] = false
121-
cp(*args)
122119
end
123120
end
121+
cp(*args)
124122
end
125123

126124
# Split a file path into individual directory names.

0 commit comments

Comments
 (0)