summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Meyer <meyer@paperplanes.de>2011-06-14 12:11:45 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-06-14 12:13:09 +0200
commit2e64e91c0c2e5e50f1b9243fd160181e47326336 (patch)
tree4963e247daa2cb440ca6f97b1218b5559e41241d /src
parente4b223b7cd673078827eba8c34b1aff32ecdb17b (diff)
Add options for escript shebang, command, emu_args
Allows customizing the arguments handed over to the Erlang VM, e.g. to set a name or a cookie, e.g. by setting escript_emu_args to: %%! -name rebar -setcookie rebar
Diffstat (limited to 'src')
-rw-r--r--src/rebar_escripter.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_escripter.erl b/src/rebar_escripter.erl
index 8b23263..f7f45ba 100644
--- a/src/rebar_escripter.erl
+++ b/src/rebar_escripter.erl
@@ -58,7 +58,11 @@ escriptize(Config, AppFile) ->
{ok, {"mem", ZipBin}} ->
%% Archive was successfully created. Prefix that binary with our
%% header and write to our escript file
- Script = <<"#!/usr/bin/env escript\n", ZipBin/binary>>,
+ Shebang = rebar_config:get(Config, escript_shebang,
+ "#!/usr/bin/env escript\n"),
+ Comment = rebar_config:get(Config, escript_comment, "%%\n"),
+ EmuArgs = rebar_config:get(Config, escript_emu_args, "%%!\n"),
+ Script = iolist_to_binary([Shebang, Comment, EmuArgs, ZipBin]),
case file:write_file(Filename, Script) of
ok ->
ok;