<br><br><div class="gmail_quote">On 2 May 2012 18:00, Sergei Golovan <span dir="ltr"><<a href="mailto:sgolovan@nes.ru" target="_blank">sgolovan@nes.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, May 2, 2012 at 7:50 PM, Farruco Sanjurjo <<a href="mailto:madtrick@gmail.com">madtrick@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> There's something with the options passed to the emulator within an escript<br>
> file that I don't get to work properly. The problem is:<br>
><br>
> If I add paths which contains glob expressions to the code path with -pa<br>
> argument in the escript file, this paths don't get added. Example:<br>
><br>
> #!/usr/bin/env escript<br>
> %%! -pa ebin deps/*/ebin<br>
<br>
</div>The argument -pa ebin deps/*/ebin is subject to shell globbing if it's<br>
supplied to the erl command in bash/zsh whatever. So, Erlang VM sees<br>
-pa ebin deps/amqp_client/ebin ... deps/reloader/ebin<br>
and processes the entire list of directories.</blockquote><div>Yep, that make sense. Thanks : ) </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In escript -pa ebin deps/*/ebin goes to Erlang VM literally, and since<br>
there's no deps/*/ebin directory, it isn't appended to the code path<br>
at all.<br>
<br>
I don't know which is the best way of adding these directories to the<br>
code path. I'd use code:add_pathsa/1 directly in main/1.<br></blockquote><div>In the meanwhile I tried this:</div><div><br></div><div>%%! -env ERL_LIBS=deps</div><div><br></div><div>and it works for me</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers!<br>
<span class="HOEnZb"><font color="#888888">--<br>
Sergei Golovan<br>
</font></span></blockquote></div><br>