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

Discover RoboFile.php on directories above the current one #462

Open
rodrigoaguilera opened this issue Oct 12, 2016 · 8 comments
Open

Discover RoboFile.php on directories above the current one #462

rodrigoaguilera opened this issue Oct 12, 2016 · 8 comments

Comments

@rodrigoaguilera
Copy link
Contributor

It would be nice to be able to install robo globally and then be able to launch robo command from any folder in your project and get the same lists of tasks

@greg-1-anderson
Copy link
Member

I don't know that it should search all the way up, but perhaps it could look in the repository root (via git rev-parse --show-toplevel), and maybe optionally REPO_ROOT/scripts/RoboFile.php.

@DavertMik what do you think?

@ahoendgen
Copy link

Also it would be nice if it´s possible to create a global RoboFile.php which provides default functions for all directories regardless they have a RoboFile or not

@greg-1-anderson
Copy link
Member

@ahoendgen
Copy link

@greg-1-anderson thx

@amenk
Copy link
Contributor

amenk commented Mar 3, 2017

You can see n98/magerun for an implementation in PHP.

@greg-1-anderson
Copy link
Member

greg-1-anderson commented Mar 3, 2017

@amenk n98/magerun appears to not use Robo. Which part of it were you recommending as a useful example?

Looking at your comment in #532 (comment), perhaps magerun execs Robo? You might want to consider adopting http://robo.li/framework/ as your base runner. If you do this, you could implemente magerun commands via the annotation mechanism Robo uses -- but you wouldn't have to rewrite any of your Symfony Console commands if you didn't want to. It's perfectly reasonable to mix the two styles, as the annotation mechanism simply produces Symfony Console commands. Just a thought.

In any event, a direct link to the parts of magerun that you think would be helpful here would be appreciated.

@amenk
Copy link
Contributor

amenk commented Mar 5, 2017

I know magerun does not use robo. But it has a detection logic for the Magento root which might be useful for detecting the Robofile Root as well ... It just goes back in the file tree until Magento was found. In our case, Robo could go back up in the tree until a Robofile was found. Git does something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants