aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_overlay.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2018-06-22 16:34:17 -0600
committerTristan Sloughter <[email protected]>2018-06-23 17:01:28 -0600
commit81b25bbe41643be9ef2bbb7583e06dbd702f61c8 (patch)
treed9e84b3647bc6bda5870e2b4e599b5f14042c74f /src/rlx_prv_overlay.erl
parentd1ee878732ead9fc381999e2340cfb8d25e77066 (diff)
downloadrelx-81b25bbe41643be9ef2bbb7583e06dbd702f61c8.tar.gz
relx-81b25bbe41643be9ef2bbb7583e06dbd702f61c8.tar.bz2
relx-81b25bbe41643be9ef2bbb7583e06dbd702f61c8.zip
only copy mode and time attributes when copying files
Diffstat (limited to 'src/rlx_prv_overlay.erl')
-rw-r--r--src/rlx_prv_overlay.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl
index a18699a..645f691 100644
--- a/src/rlx_prv_overlay.erl
+++ b/src/rlx_prv_overlay.erl
@@ -402,10 +402,8 @@ copy_to(State, FromFile0, ToFile0) ->
erlang:iolist_to_binary(filename:join(ToFile1,
filename:basename(FromFile1)))
end,
- case ec_file:copy(FromFile1, ToFile2, [recursive]) of
+ case ec_file:copy(FromFile1, ToFile2, [recursive, {file_info, [mode, time]}]) of
ok ->
- {ok, FileInfo} = file:read_file_info(FromFile1),
- ok = file:write_file_info(ToFile2, FileInfo),
ok;
{error, Err} ->
?RLX_ERROR({copy_failed,
@@ -494,8 +492,7 @@ write_template(OverlayVars, FromFile, ToFile) ->
end,
case file:write_file(ToFile, IoData) of
ok ->
- {ok, FileInfo} = file:read_file_info(FromFile),
- ok = file:write_file_info(ToFile, FileInfo),
+ ok = ec_file:copy_file_info(ToFile, FromFile, [mode, time]),
ok;
{error, Reason} ->
?RLX_ERROR({unable_to_write, ToFile, Reason})