move the actual doing stuff code for FS lib into a Guts.pm
[scpubgit/DKit.git] / lib / DX / Lib / FS / Action / SetPathMode.pm
CommitLineData
ae75ed8b 1package DX::Lib::FS::Action::SetPathMode;
2
0d1a41d9 3use DX::Lib::FS::Guts;
ae75ed8b 4use Moo;
5
6has path_status => (is => 'ro', required => 1);
7has mode => (is => 'ro', required => 1);
8
9with 'DX::Role::Action';
10
11sub expected_effect {
12 my ($self) = @_;
13 my $ps = $self->path_status;
14 +(path_status => $ps->but(info => $ps->info->but(mode => $self->mode)));
15}
16
17sub _do_run {
18 my ($self) = @_;
0d1a41d9 19 DX::Lib::FS::Guts->set_path_mode($self->path, $self->mode);
20 +(path_status => $self->path);
ae75ed8b 21}
22
231;