Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application:get_env is not properly working #76

Closed
silviucpp opened this issue Jun 8, 2016 · 2 comments
Closed

application:get_env is not properly working #76

silviucpp opened this issue Jun 8, 2016 · 2 comments

Comments

@silviucpp
Copy link

Hello,

I just added erlexec to my application dependencies and then in the sys.config I added:

    {exec,[
        {root, true}
    ]},

Once the application is starting is not finding any environment variable. I suppose because the name of the app is erlexec and not exec.

So changing the code to case application:get_env(erlexec, Option) of into the following function

add_option(Option, Acc) ->
    case application:get_env(exec, Option) of
    {ok, Value} -> [{Option, Value} | Acc];
    undefined   -> Acc
    end.

And also the app name into erlexec into sys.config fixed my issue.

What do you think ?

@saleyn
Copy link
Owner

saleyn commented Jun 8, 2016

Committed the fix. Thanks.

@saleyn saleyn closed this as completed Jun 8, 2016
@silviucpp
Copy link
Author

@saleyn I think a bug is that even if I put {root, true} and run the app as route . somehow erlexec fails and the operations are not completed fine. Without root is working fine.

Silviu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants