Skip to content

Commit

Permalink
Better output formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Sep 27, 2019
1 parent 7b0ea0c commit 1051daf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function runCommands()
}

if (!$this->isCraftInstalled()) {
$this->io->writeError('Craft is not installed yet. Skipping migration.');
$this->io->writeError(PHP_EOL . "▶ <info>Craft is not installed yet.</info> Skip migration.");
return true;
}

Expand All @@ -81,10 +81,11 @@ public function runCommands()
);

if ($cmd->run()) {
$this->io->write($cmd->getOutput());
$this->io->write(PHP_EOL . "▶ <info>Craft auto migrate</info> [migrate/all]");
$this->io->write(PHP_EOL . $cmd->getOutput());
} else {
$this->io->writeError(PHP_EOL . "▶ <info>Craft auto migrate</info> [migrate/all ERROR]");
$this->io->write($cmd->getErrorOutput());
$this->io->writeError(PHP_EOL . $cmd->getErrorOutput());
return false;
}

Expand All @@ -97,15 +98,16 @@ public function runCommands()
);

if ($cmd->run()) {
$this->io->write($cmd->getOutput());
$this->io->write(PHP_EOL . "▶ <info>Craft auto migrate</info> [project-config/sync]");
$this->io->write(PHP_EOL . $cmd->getOutput());
} else {
$this->io->writeError(PHP_EOL . "▶ <info>Craft auto migrate</info> [project-config/sync ERROR]");
$this->io->write($cmd->getErrorOutput());
$this->io->writeError(PHP_EOL .$cmd->getErrorOutput());
return false;
}
}

$this->io->write("▶ <info>Craft auto migrate</info> [END]" . PHP_EOL);
$this->io->write(PHP_EOL . "▶ <info>Craft auto migrate</info> [END]" . PHP_EOL);

return true;
}
Expand Down

0 comments on commit 1051daf

Please sign in to comment.