Skip to content

Commit

Permalink
Improve database already exists install error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ktomk committed May 7, 2016
1 parent c925a84 commit 3a64839
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/N98/Magento/Command/Installer/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,23 @@ protected function validateDatabaseSettings(OutputInterface $output, InputInterf

return $db;
}

if ($input->getOption('noDownload') && !$input->getOption('forceUseDb')) {
$output->writeln("<error>Database {$this->config['db_name']} already exists.</error>");

return false;
}

return $db;
} catch (PDOException $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
return false;
}

if ($input->getOption('noDownload') && !$input->getOption('forceUseDb')) {
$output->writeln(
sprintf(
"<error>Database '%s' already exists, use --forceUseDb in combination with --noDownload" .
" to use an existing database</error>",
$this->config['db_name']
)
);
return false;
}

return false;
return $db;
}

/**
Expand Down

0 comments on commit 3a64839

Please sign in to comment.