[erlang-questions] escript and dependencies

Brandon Clark a.brandon.clark@REDACTED
Sat Sep 6 14:35:31 CEST 2014


File globbing, i.e. the '*', is a feature of your login shell, not escript.
 If I run this:

$ erl -pa _rel/lib/*/ebin


...the shell expands the '*' before launching erl.  The command that is
actually run is this:

$ erl -pa _rel/lib/cowboy-0.10.0/ebin _rel/lib/cowlib-0.6.2/ebin
_rel/lib/crypto-3.4/ebin _rel/lib/hello_cowboy-1.0/ebin
_rel/lib/kernel-3.0.1/ebin _rel/lib/ranch-0.10.0/ebin
_rel/lib/stdlib-2.1/ebin


There may be an elegant way to perform the expansion inside your script but
I don't know what it is.  I usually rely on the quick-and-dirty solution of
running:

$ echo -pa _rel/lib/*/ebin


Then I copy and paste the output into the script:

#!/usr/bin/env escript

%% -*- erlang -*-

%%! -pa _rel/lib/cowboy-0.10.0/ebin _rel/lib/cowlib-0.6.2/ebin
_rel/lib/crypto-3.4/ebin _rel/lib/hello_cowboy-1.0/ebin
_rel/lib/kernel-3.0.1/ebin _rel/lib/ranch-0.10.0/ebin
_rel/lib/stdlib-2.1/ebin


-module(democtl).

.

.

.


~BC




On Sat, Sep 6, 2014 at 3:36 AM, Stéphane Wirtel <stephane@REDACTED> wrote:

> Hi all,
>
> How to use some external dependencies with an escript?
> Here is a script and I don't see my path to the dependencies with
> code:get_path().
>
> https://www.friendpaste.com/2PBNBucysjLeXq51uhGh3y
>
> Where is my error?
>
> Thank you,
>
> Regards,
>
> Stephane
> --
> Stéphane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140906/c16d1f6d/attachment.htm>


More information about the erlang-questions mailing list