Commit | Line | Data |
ae75ed8b |
1 | package DX::Lib::FS::Action::SetPathMode; |
2 | |
0d1a41d9 |
3 | use DX::Lib::FS::Guts; |
ae75ed8b |
4 | use Moo; |
5 | |
6 | has path_status => (is => 'ro', required => 1); |
7 | has mode => (is => 'ro', required => 1); |
8 | |
9 | with 'DX::Role::Action'; |
10 | |
11 | sub 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 | |
17 | sub _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 | |
23 | 1; |