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

[Fix #26] Fix static_files trail #35

Conversation

harenson
Copy link
Member

And upgrades trails dependency

StaticFiles =
case application:get_env(cowboy_swagger, static_files) of
{ok, Val} -> Val;
_ -> SwaggerPrivDir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of evaluating cowboy_swagger_priv() here, instead of doing StaticFiles = application:get_env(cowboy_swagger, static_files, cowboy_swagger_priv()) was to avoid the evaluation of said function if it wasn't actually needed. So, you should either do

StaticFiles = application:get_env(cowboy_swagger, static_files, cowboy_swagger_priv())

if you don't think we need to optimize that code just yet or…

case application:get_env(cowboy_swagger, static_files) of
  {ok, Val} -> Val;
  _         -> filename:join(cowboy_swagger_priv(), "swagger"),
end

…if you do ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elbrujohalcon You're right, let me change it.

elbrujohalcon pushed a commit that referenced this pull request Nov 27, 2015
…variable-is-not-good-for-releases

[Fix #26] Fix static_files trail
@elbrujohalcon elbrujohalcon merged commit 1f81947 into master Nov 27, 2015
@elbrujohalcon elbrujohalcon deleted the harenson.26.static-files-as-an-env-variable-is-not-good-for-releases branch December 3, 2015 00:47
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

Successfully merging this pull request may close these issues.

2 participants