diff --git a/lib/Pantry/App/Command/apply.pm b/lib/Pantry/App/Command/apply.pm index 4a2d6e3..2a9eff3 100644 --- a/lib/Pantry/App/Command/apply.pm +++ b/lib/Pantry/App/Command/apply.pm @@ -78,12 +78,12 @@ sub _check_name { sub _apply_runlist { my ($self, $obj, $opt) = @_; - if ($opt->{recipe}) { - $obj->append_to_run_list(map { "recipe[$_]" } @{$opt->{recipe}}); - } if ($opt->{role}) { $obj->append_to_run_list(map { "role[$_]" } @{$opt->{role}}); } + if ($opt->{recipe}) { + $obj->append_to_run_list(map { "recipe[$_]" } @{$opt->{recipe}}); + } return; } diff --git a/t/app/apply.t b/t/app/apply.t index fd34d88..8cae508 100644 --- a/t/app/apply.t +++ b/t/app/apply.t @@ -40,6 +40,12 @@ my @cases = ( run_list => [ 'role[web]' ], }, }, + { + argv => [ qw/-r postfix -r iptables -R web/ ], + expected => { + run_list => [ qw/role[web] recipe[postfix] recipe[iptables]/ ], + }, + }, { argv => [ qw/-d nginx.port=80/ ], expected => {