Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for --verbose option and error handling in generate-diff command #239

Merged
merged 2 commits into from

2 participants

@auss

No description provided.

@willdurand willdurand merged commit 4d24642 into propelorm:1.2

1 check passed

Details default The Travis CI build passed
@willdurand
Owner

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 12, 2013
  1. @auss

    Support for --verbose

    auss authored
  2. @auss
This page is out of date. Refresh to see the latest.
View
4 Command/AbstractCommand.php
@@ -95,6 +95,10 @@ protected function getPackagePrefix(Bundle $bundle, $baseDirectory = '')
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
+
+ if ($input->getOption('verbose')) {
+ $this->additionalPhingArgs[] = 'verbose';
+ }
$this->input = $input;
View
14 Command/MigrationGenerateDiffCommand.php
@@ -47,8 +47,16 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $this->callPhing('diff');
-
- $this->writeSummary($output, 'propel-sql-diff');
+ if (true === $this->callPhing('diff')) {
+ $this->writeSummary($output, 'propel-sql-diff');
+ } elseif ( strpos( $this->buffer, 'Uncommitted migrations have been found' ) ) {
+ $this->writeSection($output, array(
+ '[Propel] Error',
+ '',
+ 'Uncommitted migrations have been found. You should either execute or delete them before rerunning the propel:migration:generate-diff command.'
+ ), 'fg=white;bg=red');
+ } else {
+ $this->writeTaskError($output, 'propel-sql-diff');
+ }
}
}
Something went wrong with that request. Please try again.