eliminate support for dead arrayref argspec type
[scpubgit/DKit.git] / lib / DX / Lib / FS / Action / SetPathMode.pm
CommitLineData
ae75ed8b 1package DX::Lib::FS::Action::SetPathMode;
2
3use Moo;
4
5has path_status => (is => 'ro', required => 1);
6has mode => (is => 'ro', required => 1);
7
8with 'DX::Role::Action';
9
10sub expected_effect {
11 my ($self) = @_;
12 my $ps = $self->path_status;
13 +(path_status => $ps->but(info => $ps->info->but(mode => $self->mode)));
14}
15
16sub _do_run {
17 my ($self) = @_;
18 chmod oct($self->mode), $self->path_status->path
19 or die "Failed to chmod ${\$self->path_status->path} to ${\$self->mode}: $!";
20 +(path_status => $self->path_status);
21}
22
231;