Skip to content

Instantly share code, notes, and snippets.

@joaohf
Created March 21, 2019 20:58
Show Gist options
  • Save joaohf/03596d956ed549304936d19aa711312c to your computer and use it in GitHub Desktop.
Save joaohf/03596d956ed549304936d19aa711312c to your computer and use it in GitHub Desktop.
ReplaceIncludeErts =
fun(Path, Config) ->
ReplaceRelx(include_erts, Path, Config)
end,
ReplaceSystemLibs =
fun(Path, Config) ->
ReplaceRelx(system_libs, Path, Config)
end,
EnvTargetIncludeErts = os:getenv("REBAR3_TARGET_INCLUDE_ERTS"),
EnvTargetSystemLibs = os:getenv("REBAR3_TARGET_SYSTEM_LIBS"),
Check = {EnvTargetIncludeErts, EnvTargetSystemLibs},
case Check of
{false, false} ->
CONFIG;
{IncludeErts, false} ->
ReplaceIncludeErts(IncludeErts, CONFIG);
{false, SystemLibs} ->
ReplaceSystemLibs(SystemLibs, CONFIG);
{IncludeErts, SystemLibs} ->
CONFIG1 = ReplaceIncludeErts(IncludeErts, CONFIG),
ReplaceSystemLibs(SystemLibs, CONFIG1)
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment