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 other input for version incrementation #322

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/rebar3_hex_cut.erl
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,18 @@ try_publish(State, Repo, App, Args) ->
{error, publish_failed}
end.

increment_version(other, _CurrentVersion) ->
CustomVersion = rebar3_hex_io:ask("New Version ", string),
Parsed = parse_version(CustomVersion),
rebar3_hex_version:format(Parsed);

increment_version(Type, VersionStr) when is_list(VersionStr) orelse is_binary(VersionStr) ->
Parsed = parse_version(VersionStr),
increment_version(Type, Parsed);

increment_version(Type, Version) ->
rebar3_hex_version:format(rebar3_hex_version:increment(Type, Version)).
Inc = rebar3_hex_version:increment(Type, Version),
rebar3_hex_version:format(Inc).

get_increment(undefined, Version) ->
rebar3_hex_io:say("Select semver increment or other (Current ~s):", [Version]),
Expand All @@ -228,7 +234,7 @@ get_increment(undefined, Version) ->
rebar3_hex_io:say("4) other", []),
case rebar3_hex_io:ask("[1-4] ", number) of
4 ->
rebar3_hex_io:ask("New Version ", string);
other;
TypeInt ->
case int_to_increment(TypeInt) of
error ->
Expand Down