doc for ::Bump
This commit is contained in:
parent
615cc0f581
commit
364ad6d587
@ -3,7 +3,11 @@ package App::Changelord::Command::Bump;
|
||||
use 5.36.0;
|
||||
|
||||
use Moo;
|
||||
use CLI::Osprey desc => 'bump next version';
|
||||
use CLI::Osprey desc => 'bump next version',
|
||||
description_pod => <<'END';
|
||||
Set a version for the NEXT release based on the types of its changes.
|
||||
Also set the release date of that release to today.
|
||||
END
|
||||
|
||||
use Path::Tiny;
|
||||
use JSON;
|
||||
@ -11,15 +15,11 @@ use YAML qw/ Bless /;
|
||||
use List::AllUtils qw/ first min uniq /;
|
||||
use Version::Dotted::Semantic;
|
||||
|
||||
with 'App::Changelord::Role::Changelog';
|
||||
with 'App::Changelord::Role::ChangeTypes';
|
||||
|
||||
has changelog => ( is => 'lazy' );
|
||||
|
||||
with 'App::Changelord::Role::Versions';
|
||||
with 'App::Changelord::Role::Stats';
|
||||
|
||||
sub _build_changelog ($self) { $self->parent_command->changelog }
|
||||
|
||||
sub run ($self) {
|
||||
my $bump = shift @ARGV;
|
||||
|
||||
@ -73,7 +73,7 @@ sub run ($self) {
|
||||
Bless($_)->keys( [ uniq qw/ version date changes /, sort keys %$_ ] );
|
||||
}
|
||||
|
||||
path( $self->parent_command->source )->spew( YAML::Dump($change) );
|
||||
path( $self->source )->spew( YAML::Dump($change) );
|
||||
|
||||
say "new version minted: $version";
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use feature 'try';
|
||||
requires 'changelog';
|
||||
|
||||
sub latest_version($self){
|
||||
first { $_ } grep { $_ ne 'NEXT' } map { eval { $_->{version} } } $self->changelog->{releases}->@*;
|
||||
first { $_ } grep { $_ ne 'NEXT' } map { eval { $_->{version} || '' } } $self->changelog->{releases}->@*, 'v0.0.0';
|
||||
}
|
||||
|
||||
sub next_version($self) {
|
||||
@ -29,7 +29,10 @@ sub next_version($self) {
|
||||
map { $_ => $level } $_->{keywords}->@*
|
||||
} $self->change_types->@*;
|
||||
|
||||
my $bump =min 2, map { $_ eq 'major' ? 0 : $_ eq 'minor' ? 1 : 2 } map { $mapping{$_->{type}} || 'patch' } $upcoming->{changes}->@*;
|
||||
no warnings;
|
||||
my $bump =min 2, map { $_ eq 'major' ? 0 : $_ eq 'minor' ? 1 : 2 } map { $mapping{$_->{type}} || 'patch' }
|
||||
map { ref ? $_ : { desc => $_ } }
|
||||
$upcoming->{changes}->@*;
|
||||
|
||||
$version->bump($bump);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user