Skip to content
Snippets Groups Projects
Commit ccbb36b5 authored by jurgenhaas's avatar jurgenhaas
Browse files

#3 Use correct vendor directory

parent efb09fc0
No related branches found
Tags v1.5.1
No related merge requests found
...@@ -40,6 +40,7 @@ class Handler extends BaseHandler { ...@@ -40,6 +40,7 @@ class Handler extends BaseHandler {
]; ];
} }
$rootDir = getcwd();
$installationManager = $this->composer->getInstallationManager(); $installationManager = $this->composer->getInstallationManager();
foreach ($this->composer->getRepositoryManager()->getLocalRepository()->search('lakedrops/*') as $pkg) { foreach ($this->composer->getRepositoryManager()->getLocalRepository()->search('lakedrops/*') as $pkg) {
$pluginRoot = $installationManager->getInstallPath($this->getPackage($pkg['name'])); $pluginRoot = $installationManager->getInstallPath($this->getPackage($pkg['name']));
...@@ -49,13 +50,13 @@ class Handler extends BaseHandler { ...@@ -49,13 +50,13 @@ class Handler extends BaseHandler {
$ahoy['commands'][$command] = $commands; $ahoy['commands'][$command] = $commands;
if (isset($commands['imports']) && is_array($commands['imports'])) { if (isset($commands['imports']) && is_array($commands['imports'])) {
foreach ($commands['imports'] as $key => $import) { foreach ($commands['imports'] as $key => $import) {
$ahoy['commands'][$command]['imports'][$key] = './vendor/' . $pkg['name'] . '/' . $import; $ahoy['commands'][$command]['imports'][$key] = '.' . substr($pluginRoot, strlen($rootDir)) . '/' . $import;
} }
} }
} }
} }
} }
$file = getcwd() . '/.ahoy.yml'; $file = $rootDir . '/.ahoy.yml';
file_put_contents($file, $rendered = Yaml::dump($ahoy, 9, 2)); file_put_contents($file, $rendered = Yaml::dump($ahoy, 9, 2));
$this->gitIgnore('.ahoy.yml'); $this->gitIgnore('.ahoy.yml');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment