Merge pull request #7759 from open-sausages/pulls/4/fix-doctor-public

BUG Fix `upgrade-code doctor` with public path
This commit is contained in:
Daniel Hensby 2018-01-16 08:40:18 +00:00 committed by GitHub
commit 58a8463441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)) {