priv dir in escript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

priv dir in escript

Karlo Kuna
I'm trying to make self contained escript
i need priv folder to be included in archive in escript

currently i'm extracting files using: 'escript:extract' 
but in arhive there is no `priv` directory

i'm building with rebar3 escriptize 

any help would be appreciated 

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: priv dir in escript

Tristan Sloughter-4

We definitely need to add this to the docs on rebar3.org, it wasn't documented for historical reasons but it has been stable api for years now.

This should work if you replace the app name part with your app's name:

{escript_incl_extra, [{"<YOUR APP NAME>/priv/*, "_build/default/lib/"}]}.
It could use improvements to like replace os vars for the profile, but it at least works

On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote:
I'm trying to make self contained escript
i need priv folder to be included in archive in escript

currently i'm extracting files using: 'escript:extract' 
but in arhive there is no `priv` directory

i'm building with rebar3 escriptize 

any help would be appreciated 
_______________________________________________
erlang-questions mailing list


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: priv dir in escript

Karlo Kuna
hey Tristan

thanks for the reply 
i have tried your proposal but had no luck

i'm running rebar 3.6.1 on Erlang/OTP 21 Erts 10.0 on linux 

what am i missing? 

On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter <[hidden email]> wrote:

We definitely need to add this to the docs on rebar3.org, it wasn't documented for historical reasons but it has been stable api for years now.

This should work if you replace the app name part with your app's name:

{escript_incl_extra, [{"<YOUR APP NAME>/priv/*, "_build/default/lib/"}]}.
It could use improvements to like replace os vars for the profile, but it at least works

On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote:
I'm trying to make self contained escript
i need priv folder to be included in archive in escript

currently i'm extracting files using: 'escript:extract' 
but in arhive there is no `priv` directory

i'm building with rebar3 escriptize 

any help would be appreciated 
_______________________________________________
erlang-questions mailing list

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: priv dir in escript

Tristan Sloughter-4
Can you share your config or even the whole project?

On Sun, Jul 29, 2018, at 3:47 PM, Karlo Kuna wrote:
hey Tristan

thanks for the reply 
i have tried your proposal but had no luck

i'm running rebar 3.6.1 on Erlang/OTP 21 Erts 10.0 on linux 

what am i missing? 

On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter <[hidden email]> wrote:


We definitely need to add this to the docs on rebar3.org, it wasn't documented for historical reasons but it has been stable api for years now.

This should work if you replace the app name part with your app's name:

{escript_incl_extra, [{"<YOUR APP NAME>/priv/*, "_build/default/lib/"}]}.
It could use improvements to like replace os vars for the profile, but it at least works

On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote:
I'm trying to make self contained escript
i need priv folder to be included in archive in escript

currently i'm extracting files using: 'escript:extract' 
but in arhive there is no `priv` directory

i'm building with rebar3 escriptize 

any help would be appreciated 
_______________________________________________
erlang-questions mailing list

_______________________________________________
erlang-questions mailing list


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: priv dir in escript

Karlo Kuna
In reply to this post by Tristan Sloughter-4
OK, 

i have got it to work 
having followed Tristan's advice and also looking at rebar3 source code

this is my conclusion: 
{escript_incl_extra, [{"<wildcard_pattern>""_build/default/lib/"}]}.

escript_incl_extra is using wildcard_pattern to search for files so if you want all nested files one would write: "my_app/priv/**".
In the result empty folders are omitted (shame)!

On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter <[hidden email]> wrote:

We definitely need to add this to the docs on rebar3.org, it wasn't documented for historical reasons but it has been stable api for years now.

This should work if you replace the app name part with your app's name:

{escript_incl_extra, [{"<YOUR APP NAME>/priv/*, "_build/default/lib/"}]}.
It could use improvements to like replace os vars for the profile, but it at least works

On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote:
I'm trying to make self contained escript
i need priv folder to be included in archive in escript

currently i'm extracting files using: 'escript:extract' 
but in arhive there is no `priv` directory

i'm building with rebar3 escriptize 

any help would be appreciated 
_______________________________________________
erlang-questions mailing list

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions