BUG Fix `upgrade-code doctor` with public path

This commit is contained in:
Damian Mooyman 2018-01-16 15:38:12 +13:00
parent 5a18c3c405
commit 20348b5f42
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
1 changed files with 5 additions and 3 deletions

View File

@ -36,11 +36,13 @@ class UpgradeBootstrap
*/
public function __invoke(InputInterface $input, OutputInterface $output, $basePath)
{
$publicPath = file_exists("{$basePath}/public") ? "{$basePath}/public" : $basePath;
// Fail if destination isn't writable
$this->ensureWritable($basePath);
$this->ensureWritable($publicPath);
// Check source
$source = $basePath . '/vendor/silverstripe/recipe-core';
$source = $basePath . '/vendor/silverstripe/recipe-core/public';
if (!is_dir($source)) {
throw new BadMethodCallException("silverstripe/recipe-core is not installed.");
}
@ -49,7 +51,7 @@ class UpgradeBootstrap
$output->writeln("Upgrading project bootstrapping files:");
foreach ($this->files as $file => $canCreate) {
$fileSource = $source . '/' . $file;
$fileDest = $basePath . '/' . $file;
$fileDest = $publicPath . '/' . $file;
// Skip if we should only upgrade existing files
if (!$canCreate && !file_exists($fileDest)) {