diff options
author | Juhani Rankimies <juhani@juranki.com> | 2010-12-26 13:56:17 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-01-06 15:02:23 +0100 |
commit | 9441251f9fa7e214a35abd1b4d4eef85d4dc35c3 (patch) | |
tree | 142bffdc2ce7d5778d117b4ec155c285b560b1a2 | |
parent | 52ca7795feb001f0624ec87e717e3019f8a810bd (diff) |
Use file:change_mode/2 instead of invoking chmod
-rw-r--r-- | src/rebar_escripter.erl | 4 |
1 files changed, 3 insertions, 1 deletions
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) -> |