mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
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
This commit is contained in:
parent
e4b223b7cd
commit
2e64e91c0c
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue