You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the problem this feature will solve?
What I'm trying to do is move all the files that are supporting tooling/code for the project into a tools/ directory. Invoke's tasks/ folder is one folder that I can not move since it doesn't support configuration of the loading of tasks.
If I am able to configure the loading process, I can:
have the clarity of the tools/ directory
allow other contributors of the project to use invoke without any additional configuration or CLI arguments, on their end
work on other codebases that use invoke without having to pass CLI arguments
Essentially, I will not have to manage the location of the tasks module every time I switch to a different project.
Describe the solution you'd like
One straightforward solution that comes to my mind is loading configuration files from the current directory in the first stage -- before discovering tasks.
Yet another way to achieve this would be to enable this via #537 (which IMO would be really nice).
Alternative Solutions
I am currently using a tasks/ package outside of the tools/ directory but being able to move that into tools/ would be nice. :)
The text was updated successfully, but these errors were encountered:
As you may be able to guess, this tactic only works if you put the tasks.collection_name configuration somewhere that is loaded prior to seeking the collection itself - currently that'd be user, system or runtime level config files.
A quick example from my invoke-1.0.0 using localhost, with no actual valid task files in play so we get the "what was it looking for?" error message:
[14:18] tachi:~/tmp {-} [master]
» inv -l
Can't find any collection named 'tasks'!
[14:19] tachi:~/tmp {-} [master]
» echo "tasks:
dquote> collection_name: something_else
dquote> " > ~/.invoke.yml
[14:19] tachi:~/tmp {-} [master]
» inv -l
Can't find any collection named 'something_else'!
Actually, I realize I'm misreading some of what you wrote, you're saying "their root directory" - I interpreted this as home directory but I think you do literally mean the project directory.
In that case, this becomes an order of operations design problem, because project-level config files do not currently get loaded until after the tasks collection is found, because "the project root" is defined as "where the tasks collection lives". Makes this particular request a bit of a chicken and egg problem!
I assume that the most obvious workaround is to add another pseudo-config-level of "invocation $CWD", which a lot of tools (IMHO not always correctly!) use as a stand-in for actual project root.
As you note, #537 (which would still I think need to be done in tandem with some explicit "we will look for some things in CWD instead of next-to-the-tasks-collection" additions) might be a better way to solve this, instead of making the built-in config stuff that much more complicated.
What's the problem this feature will solve?
What I'm trying to do is move all the files that are supporting tooling/code for the project into a
tools/
directory. Invoke's tasks/ folder is one folder that I can not move since it doesn't support configuration of the loading of tasks.If I am able to configure the loading process, I can:
Essentially, I will not have to manage the location of the tasks module every time I switch to a different project.
Describe the solution you'd like
One straightforward solution that comes to my mind is loading configuration files from the current directory in the first stage -- before discovering tasks.
Yet another way to achieve this would be to enable this via #537 (which IMO would be really nice).
Alternative Solutions
I am currently using a
tasks/
package outside of thetools/
directory but being able to move that intotools/
would be nice. :)The text was updated successfully, but these errors were encountered: