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

Support shuttle commands from sub directories #72

Merged
merged 3 commits into from
Sep 7, 2021

Conversation

Crevil
Copy link
Member

@Crevil Crevil commented Sep 6, 2021

Currently when shuttle is invoked it needs to be in the root of a project. This
limits its uses in scripts like go:generate where files in sub directories would
rely on the root project path.

This change adds a recursive lookup of the project path by walking backwards in
the file tree to find a shuttle.yaml file. This is a well known pattern from
other CLIs like Git where a CLI command from a sub directory acts as if it was
invoked from the project root.

Currently when shuttle is invoked it needs to be in the root of a project. This
limits its uses in scripts like go:generate where files in sub directories would
rely on the root project path.

This change adds a recursive lookup of the project path by walking backwards in
the file tree to find a shuttle.yaml file. This is a well known pattern from
other CLIs like Git where a CLI command from a sub directory acts as if it was
invoked from the project root.
@Crevil Crevil requested a review from a team September 6, 2021 20:42
@Crevil
Copy link
Member Author

Crevil commented Sep 7, 2021

A test case is failing where the -p flag is used but now, if we do not find a shuttle.yaml file we will traverse the tree hitting shuttle's shuttle.yaml file.

I think we should disable the traversal when using the -p flag.

Copy link
Member

@mahlunar mahlunar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very NIce 🚀

@Crevil Crevil merged commit eb11765 into master Sep 7, 2021
@Crevil Crevil deleted the feature/sub-dir-project-paths branch September 7, 2021 12:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants