Update to current Perl
This commit is contained in:
parent
ebd46d86d4
commit
3cc88f8150
57 changed files with 11638 additions and 665 deletions
40
lib/WGDev/Command/Run.pm
Normal file
40
lib/WGDev/Command/Run.pm
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package WGDev::Command::Run;
|
||||
# ABSTRACT: Run arbitrary shell command
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.008008;
|
||||
|
||||
use parent qw(WGDev::Command::Base);
|
||||
|
||||
sub process {
|
||||
my $self = shift;
|
||||
$self->wgd->set_environment;
|
||||
my @arguments = $self->arguments;
|
||||
my $command = shift @arguments;
|
||||
my $result = system {$command} $command, @arguments;
|
||||
return $result ? 0 : 1;
|
||||
}
|
||||
|
||||
sub parse_params {
|
||||
my ( $self, @args ) = @_;
|
||||
$self->arguments( \@args );
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
wgd run <command>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Runs an arbitrary command, but sets the C<WEBGUI_CONFIG>, C<WEBGUI_ROOT>, and
|
||||
C<PERL5LIB> environment variables first.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
Has no options of its own. All options are passed on to specified command.
|
||||
|
||||
=cut
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue