erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

fix handling of default_release in config #679

Closed aboroska closed 5 years ago

aboroska commented 5 years ago

Fixes #650 and https://github.com/erlang/rebar3/issues/1629.

When no release specified in cli, prevent overwriting default_release in relx config.

The issue this PR fixes is the following: create a new rebar3 release project by

rebar3 new release a
cd a/apps
rebar3 new app b
cd ..

edit rebar.config

{relx, [{default_release, {b, "0.1.0"}},
        {release, {a, "0.1.0"},
         [a,
          sasl]},
        {release, {b, "0.1.0"},
         [b,
          sasl]}
]}.

rebar3 release does not pick up the configured default_release but shows error instead:

===> No default release name was specified and there are multiple releases in the config: b, a
aboroska commented 5 years ago

Ah, the complete solution will be more complicated, bear with me.

aboroska commented 5 years ago

Force pushed with an improved fix. CTs are passing on my macOS.

aboroska commented 5 years ago

Forced pushed a couple more times with space diffs in the commit message to trigger a passing osx build.