Support modules as base packages instead of just installed in vendor/

This commit is contained in:
Austen McDonald
2016-08-22 21:54:53 +00:00
parent 86751fc6d5
commit 5fc6822737
+7 -2
View File
@@ -38,12 +38,17 @@ class LibraryConfiguration
$this->composerManager = $composerManager;
$this->package = $package;
// Only lotgd-modules are installed in the vendor directory
$path = '';
if ($package->getType() === "lotgd-module") {
$basePackage = $composerManager->getComposer()->getPackage();
if ($basePackage && $basePackage->getName() === $package->getName()) {
// Whatever the base package is in this repo is at $cwd.
$path = $cwd;
} else if ($package->getType() === "lotgd-module") {
// lotgd-modules are installed in the vendor directory.
$installationManager = $composerManager->getComposer()->getInstallationManager();
$path = $installationManager->getInstallPath($package);
} else {
// Not sure what it is honestly, just use $cwd.
$path = $cwd;
}