doc for ::Add
This commit is contained in:
parent
d555b10db9
commit
615cc0f581
@ -3,15 +3,17 @@ package App::Changelord::Command::Add;
|
|||||||
use 5.36.0;
|
use 5.36.0;
|
||||||
|
|
||||||
use Moo;
|
use Moo;
|
||||||
use CLI::Osprey desc => 'add a change to the changelog';
|
use CLI::Osprey
|
||||||
|
desc => 'add a change to the NEXT release',
|
||||||
|
description_pod => <<'END';
|
||||||
|
Add a change entry to the NEXT release.
|
||||||
|
END
|
||||||
|
|
||||||
use PerlX::Maybe;
|
use PerlX::Maybe;
|
||||||
use Path::Tiny;
|
use Path::Tiny;
|
||||||
use App::Changelord::Command::Init;
|
use App::Changelord::Command::Init;
|
||||||
|
|
||||||
has changelog => ( is => 'lazy' );
|
with 'App::Changelord::Role::Changelog';
|
||||||
|
|
||||||
sub _build_changelog ($self) { $self->parent_command->changelog }
|
|
||||||
|
|
||||||
# TODO validate the type
|
# TODO validate the type
|
||||||
option type => (
|
option type => (
|
||||||
@ -48,7 +50,7 @@ sub next_release($self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub save_changelog($self) {
|
sub save_changelog($self) {
|
||||||
my $src = $self->parent_command->source;
|
my $src = $self->source;
|
||||||
|
|
||||||
path($src)->spew( App::Changelord::Command::Init::serialize_changelog($self) );
|
path($src)->spew( App::Changelord::Command::Init::serialize_changelog($self) );
|
||||||
}
|
}
|
||||||
@ -63,6 +65,8 @@ sub run ($self) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$self->save_changelog;
|
$self->save_changelog;
|
||||||
|
|
||||||
|
say "change added to the changelog";
|
||||||
}
|
}
|
||||||
|
|
||||||
'end of App::Changelog::Command::Add';
|
'end of App::Changelog::Command::Add';
|
||||||
|
Loading…
Reference in New Issue
Block a user