From 9441251f9fa7e214a35abd1b4d4eef85d4dc35c3 Mon Sep 17 00:00:00 2001 From: Juhani Rankimies Date: Sun, 26 Dec 2010 13:56:17 +0100 Subject: Use file:change_mode/2 instead of invoking chmod --- src/rebar_escripter.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rebar_escripter.erl b/src/rebar_escripter.erl index f2870d3..20f5e66 100644 --- a/src/rebar_escripter.erl +++ b/src/rebar_escripter.erl @@ -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) -> -- cgit v1.1