-
Notifications
You must be signed in to change notification settings - Fork 501
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
Allow certain recipes to be expliciltly marked as runnable in children directories #761
Comments
Thanks for the issue! I think these are good ideas. I'm generally a bit hesitant to add new syntax, since it can be hard to read, and also a bit hard to plan, since different syntax elements can conflict with each other. However, I think implementing some of these things with a generic annotation/attribute syntax, as proposed in #604, would be the way to go. Some of what's proposed is There isn't an equivalent for
I'm not sure what I think that
|
If put before the recipe name, it means that that recipe indeed can be called from a subdirectory, and the current working directory would be Thanks for the amazing tool btw, no more monthly fiddling with |
I'm not following, isn't that the default behavior? Currently, normal recipes can be called from any subdirectory, and the default directory is the one that contains the justfile.
You bet! So glad to hear it's useful. |
Wow, so yeah I just reread the manual and it looks like just does automatically look up for |
Glad you fixed it! I like the idea of having an annotation to prevent a recipe for changing directories, so I created #762 to track that separately. |
Created #1048, sorry for the noise |
It is also important to note here that like global config which I recall that you've shown aversion to in the past for adding complication, inheritance as described above can potentially have the same effect and make things unclear in a multiuser environment. A counter argument to this would be the presence of |
I'll start with an example (actual text at end). One term I'm going to use is "owning directory" which is to say the directory which contains the
.just
file.Say my recipe is
git status
I however need to be in the directory with my
.just
file. (so called "Owning directory")Now say I change it to
This means that git status can be run from any child directory in the repository. But it will still consider its working directory as the owning directory.
Now say I change it again to
This would still have working directory as owning directory but the command would be
git status <relative path of current directory from owning directory>
Now say I change it again to
This would still have working directory as the owning directory but the command would be
git status <absolute path of current directory>
Now say I change it again to
This would still have working directory as owning directory but the command would be
git status <path of directory with .just file>
Now say I change it again to
The working directory of this recipe would be the current directory.
All these recipes would be invoked using plain
j gs
.Proposal
Hello,
I want to propose a feature where you can allow a chosen subset of recipes to be callable from children. The purpose is to be able to run commands like
git status
(and ...?) from child directories without having to navigate to git root, or having multiple.just
files scattered around.There would be two components to this feature.
.just
file), current directory relative to owning directory, and absolute path to current directory.I propose the following:
~
is meant to be inheritable.~
beginning recipe. If the second character is~
then working directory would be the owning directory. If the second character is.
then the working directory would be the invocation directory.~~
,~.
,~/
. They meanowning directory
,invocation directory (relative to owning)
,invocation directory (absolute)
.Implementation questiosn:
How do you go up and find out which of the parent directories has a
.just
file? What if the parent is a link? If so, what to do about the relative path?When passing owning directory, should its absolute path be passed or relative, or both should have their individual symbols? (I ran out of symbols...)
The text was updated successfully, but these errors were encountered: