mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Use file:change_mode/2 instead of invoking chmod
This commit is contained in:
parent
52ca7795fe
commit
9441251f9f
1 changed files with 3 additions and 1 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue