Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Commit

Permalink
Move _run_command method to mysql class
Browse files Browse the repository at this point in the history
The Pg class doesn't need this at all
  • Loading branch information
autarch committed Apr 1, 2013
1 parent 2945eec commit 7e55981
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions lib/Database/Migrator/Core.pm
Expand Up @@ -189,45 +189,6 @@ sub _run_one_migration {
return;
}

sub _run_command {
my $self = shift;
my $command = shift;
my $input = shift;

my $stdout = q{};
my $stderr = q{};

my $handle_stdout = sub {
$self->logger()->debug(@_);

$stdout .= $_ for @_;
};

my $handle_stderr = sub {
$self->logger()->debug(@_);

$stderr .= $_ for @_;
};

$self->logger()->debug("Running command: [@{$command}]");

return if $self->dry_run();

run3( $command, \$input, $handle_stdout, $handle_stderr );

if ($?) {
my $exit = $? >> 8;

my $msg = "@{$command} returned an exit code of $exit\n";
$msg .= "\nSTDOUT:\n$stdout\n\n" if length $stdout;
$msg .= "\nSTDERR:\n$stderr\n\n" if length $stderr;

die $msg;
}

return $stdout;
}

sub _build_pending_migrations {
my $self = shift;

Expand Down

0 comments on commit 7e55981

Please sign in to comment.