Replies: 4 comments
-
|
I just found out that it does work if you leave out the leading EDIT: Sorry, all-clear canceled. I thought the problem was solved because the version without By the way, a reference whose path has leading |
Beta Was this translation helpful? Give feedback.
-
|
It's a bit of a grey area here. You're right, in CLI I implemented lookup only relative to a folder with recipes (base path). This approach is simpler, but maybe not intuitive. The original proposal doesn't specify rules how recipe look up should be done (oops!). And it didn't come up during discussion. The question is what's the user expectation here. I think can be both. Need to discuss. Also, I think |
Beta Was this translation helpful? Give feedback.
-
Fair. I think there is a strong argument to be made for relative paths (i.e. to the recipe): If such paths are not allowed, usability is becomes much more limited. The user is essentially limited to using a single directory from which the commands can be reliably invoked. This is natural if you put all your recipes next to each other in the same directory, but not if you have subdirectories – and to me it feels quite natural to group recipes belonging to a similar category into a subdirectory. Such a use case is not entirely unsupported right now, but to make it work you have to decide on a directory from where you will always invoke the commands (presumably the root directory) and then write all your references relative to that directory rather than the one in which you’re working when you write the recipe. That feels rather unintuitive to me. If we had relative paths, this friction would be removed. In addition,you could invoke the commands from a subdirectory to limit them to recipes in that directory. This is possible right now by using the As for |
Beta Was this translation helpful? Give feedback.
-
|
I just had a thought which serves as a counterargument: If lookup is relative to the recipe, that obviously fixes the folder structure into the recipes. Suppose I want to move or rename a recipe. I now have to find and update all updates that reference it. Worse, suppose I want to rename/move a directory. Then I have to track down all references to any children (recursively) from the outside. There is an argument to be made that such action at a distance is also surprising and annoying. That said, the current state has the same issue and additionally the one which I found surprising above, where recipes can be flagged invalid if the command is not invoked from the exact right position in the folder structure. One solution I can think of: Say we have something marking the root directory of our collection (say, a Alternatively, there could be a mechanism which imports recipes independent of their file name and path from the root. That could be a crawler which recursively traverses all subdirectories of the root and includes everything (not sure how slow that would be – but maybe acceptable if we hold off on parsing more than the metadata and/or there is some way to cache results for later commands). Then recipes could reference each other by title rather than file path. Advantages:
Disadvantages:
I‘m not convinced the advantages outweigh the disadvantages here … Thoughts? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When you reference another recipe as an ingredient, the link appears to be interpreted by the cli as relative to the current pwd rather than the recipe’s location. For instance, say you have two recipes
Chicken stock.cookandChicken soup.cookin the same directory, where the latter contains the following:cook doctor validateconsiders this valid if and only ifyou invoke it from the same directory. If you invoke it from a parent directory, it reports an invalid reference.I would expect the reference to be interpreted as relative to the referencing recipe’s location because the way it is, I have to validate each directory with such recipes separately.
Thanks for your awesome work! This seems like a very interesting project!
Beta Was this translation helpful? Give feedback.
All reactions