[erlang-questions] Arguments to emulator in escript

Farruco Sanjurjo madtrick@REDACTED
Wed May 2 18:06:30 CEST 2012


On 2 May 2012 18:00, Sergei Golovan <sgolovan@REDACTED> wrote:

> On Wed, May 2, 2012 at 7:50 PM, Farruco Sanjurjo <madtrick@REDACTED>
> wrote:
> > Hi,
> >
> > There's something with the options passed to the emulator within an
> escript
> > file that I don't get to work properly. The problem is:
> >
> > If I add paths which contains glob expressions to the code path with -pa
> > argument in the escript file, this paths don't get added. Example:
> >
> > #!/usr/bin/env escript
> > %%! -pa ebin deps/*/ebin
>
> The argument -pa ebin deps/*/ebin is subject to shell globbing if it's
> supplied to the erl command in bash/zsh whatever. So, Erlang VM sees
> -pa ebin deps/amqp_client/ebin ... deps/reloader/ebin
> and processes the entire list of directories.

Yep, that make sense. Thanks : )

>
> In escript -pa ebin deps/*/ebin goes to Erlang VM literally, and since
> there's no deps/*/ebin directory, it isn't appended to the code path
> at all.
>
> I don't know which is the best way of adding these directories to the
> code path. I'd use code:add_pathsa/1 directly in main/1.
>
In the  meanwhile I tried this:

%%! -env ERL_LIBS=deps

and it works for me

>
> Cheers!
> --
> Sergei Golovan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120502/9600f40b/attachment.htm>


More information about the erlang-questions mailing list