diff --git a/Command/AclInitCommand.php b/Command/AclInitCommand.php index 1c5e043..0009eec 100644 --- a/Command/AclInitCommand.php +++ b/Command/AclInitCommand.php @@ -82,22 +82,28 @@ EOT return 2; } - // insert sql - $sqlInsertCmd = new \Propel\Generator\Command\SqlInsertCommand(); - $sqlInsertArgs = array( - '--connection' => $this->getConnections($input->getOption('connection')), - ); - - if ($this->runCommand($sqlBuildCmd, $sqlBuildArgs, $input, $output) === 0) { - $this->writeSection( - $output, - '1 SQL file has been inserted.' + + if ($input->getOption('force')) { + // insert sql + $sqlInsertCmd = new \Propel\Generator\Command\SqlInsertCommand(); + $sqlInsertArgs = array( + '--connection' => $this->getConnections($input->getOption('connection')), + '--sql-dir' => $this->getCacheDir(), ); - } else { - $this->writeTaskError($output, 'sql:insert'); - return 3; + if ($this->runCommand($sqlInsertCmd, $sqlInsertArgs, $input, $output) === 0) { + $this->writeSection( + $output, + '1 SQL file has been inserted.' + ); + } else { + $this->writeTaskError($output, 'sql:insert'); + + return 3; + } } + + return 0; } /**