Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Use localDistributionFolders on package:create #1433

Merged
merged 1 commit into from Nov 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions Neos.Flow/Classes/Package/PackageManager.php
Expand Up @@ -340,6 +340,18 @@ public function createPackage($packageKey, array $manifest = [], $packagesPath =
$manifest['type'] = PackageInterface::DEFAULT_COMPOSER_TYPE;
}

$runComposerRequireForTheCreatedPackage = false;
if ($packagesPath === null) {
$composerManifestRepositories = ComposerUtility::getComposerManifest(FLOW_PATH_ROOT, 'repositories');
foreach ($composerManifestRepositories as $repository) {
if ($repository['type'] == 'path' && substr($repository['url'], 0, 2) == './' && substr($repository['url'], -2) == '/*') {
$packagesPath = Files::getUnixStylePath(Files::concatenatePaths([FLOW_PATH_ROOT, substr($repository['url'], 0, -2)]));
$runComposerRequireForTheCreatedPackage = true;
break;
}
}
}

if ($packagesPath === null) {
$packagesPath = 'Application';
if (is_array($this->settings['packagesPathByType']) && isset($this->settings['packagesPathByType'][$manifest['type']])) {
Expand All @@ -365,6 +377,10 @@ public function createPackage($packageKey, array $manifest = [], $packagesPath =

$manifest = ComposerUtility::writeComposerManifest($packagePath, $packageKey, $manifest);

if ($runComposerRequireForTheCreatedPackage) {
exec('composer require ' . $manifest['name'] . ' @dev');
}

$refreshedPackageStatesConfiguration = $this->rescanPackages();
$this->packageStatesConfiguration = $refreshedPackageStatesConfiguration;
$this->registerPackageFromStateConfiguration($manifest['name'], $this->packageStatesConfiguration['packages'][$manifest['name']]);
Expand Down