Skip to content

Commit 06f5f31

Browse files
Fix passing of File.cp_r! on_conflict option (#12015)
1 parent fc7d8de commit 06f5f31

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/mix/lib/mix/release.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ defmodule Mix.Release do
773773

774774
release.erts_source
775775
|> Path.join("bin")
776-
|> File.cp_r!(destination, fn _, _ -> false end)
776+
|> File.cp_r!(destination, on_conflict: fn _, _ -> false end)
777777

778778
_ = File.rm(Path.join(destination, "erl"))
779779
_ = File.rm(Path.join(destination, "erl.ini"))

lib/mix/lib/mix/utils.ex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,13 @@ defmodule Mix.Utils do
518518

519519
{:error, _} ->
520520
files =
521-
File.cp_r!(source, target, fn orig, dest ->
522-
{orig_mtime, orig_size} = last_modified_and_size(orig)
523-
{dest_mtime, dest_size} = last_modified_and_size(dest)
524-
orig_mtime > dest_mtime or orig_size != dest_size
525-
end)
521+
File.cp_r!(source, target,
522+
on_conflict: fn orig, dest ->
523+
{orig_mtime, orig_size} = last_modified_and_size(orig)
524+
{dest_mtime, dest_size} = last_modified_and_size(dest)
525+
orig_mtime > dest_mtime or orig_size != dest_size
526+
end
527+
)
526528

527529
{:ok, files}
528530
end

0 commit comments

Comments
 (0)