Use file:change_mode/2 instead of invoking chmod

This commit is contained in:
Juhani Rankimies 2010-12-26 13:56:17 +01:00 committed by Tuncer Ayaz
parent 52ca7795fe
commit 9441251f9f

View file

@ -30,6 +30,7 @@
clean/2]).
-include("rebar.hrl").
-include_lib("kernel/include/file.hrl").
%% ===================================================================
%% Public API
@ -70,7 +71,8 @@ escriptize(Config, AppFile) ->
end,
%% Finally, update executable perms for our script
[] = os:cmd(?FMT("chmod u+x ~p", [Filename])),
{ok, #file_info{mode = Mode}} = file:read_file_info(Filename),
ok = file:change_mode(Filename, Mode bor 8#00100),
ok.
clean(Config, AppFile) ->