Archer::Plugin::Exec::Local - run the command in local machine.


Archer documentation Contained in the Archer distribution.

Index


Code Index:

NAME

Top

Archer::Plugin::Exec::Local - run the command in local machine.

SYNOPSIS

Top

  - module: Exec::Local
    config:
      user: root
      command: ls [% work_dir %]/[% project %]/

DESCRIPTION

Top

run the command in local machine.

AUTHORS

Top

Tokuhiro Matsuno.


Archer documentation Contained in the Archer distribution.

package Archer::Plugin::Exec::Local;
use strict;
use warnings;
use base qw/Archer::Plugin::Exec/;

sub _execute {
    my ($self, $cmd, $args) = @_;

    my $user = $self->{config}->{user};
    my $real_command = $user ? "sudo -u $user $cmd " : $cmd;
    $self->log(debug => "real execute: $real_command");

    system $real_command; # XXX security!!!
}

1;
__END__