Missed path to project's ./acquiacli.yml when not root package
simesy opened this issue · 2 comments
I suppose acquia_cli is normally used as a root package, as I'm having some trouble getting it to pick up the acquiacli.yml when located in ./vendor. Focussing here: https://github.com/typhonius/acquia_cli/blob/master/bin/acquiacli-robo.php#L10-L35
When i dump $paths I get:
array(3) {
[0]=>
string(78) "/PROJECTPATH/vendor/typhonius/acquia_cli/default.acquiacli.yml"
[1]=>
string(34) "/Users/si/.acquiacli/acquiacli.yml"
[2]=>
string(84) "/PROJECTPATH/vendor/typhonius/acquia_cli/bin/../../..//acquiacli.yml"
}
and the third one is ./vendor/acquiacli.yml, when it should be ./acquiacli.yml according to the docs - missed it by one.
I don't know what the right solution is, but I'll do a patch to check for getcwd() . '/acquiacli.yml
- since on my machine getcwd()
returns the project root.
Thanks @simesy, although getcwd()
would work, but only if executed from the PROJECTPATH directory.
I had a quick play around and something like the following might be more resilient (this changes some of the existing code within the acquiacli-robo.php file. If I could ask you to check this, ensure that we're not forgetting anything by replacing what's there currently, and then revising your PR, I'll be able to merge that in.
} elseif (file_exists(dirname(__DIR__) . '/../../autoload.php')) {
$root = dirname(__DIR__) . '/../../../';
require_once dirname(__DIR__) . '/../../autoload.php';
}
works here - thanks!