knope icon indicating copy to clipboard operation
knope copied to clipboard

Detect knope.toml in parent directories

Open Shadow53 opened this issue 4 years ago • 1 comments

I'd like to be able to run dobby without having to be in the exact directory containing the dobby.toml. I may make the last git commit from a child directory, and it would smooth out the workflow to not need to cd.

A couple thoughts:

  • This will include some sort of procdeural check through every parent directory
  • We may want to stop searching after checking the root of the current git repository (git rev-parse --show-toplevel).
  • What about git submodules where the submodule does not have a dobby.toml but the parent repo does?
  • Should there be support for a global dobby.toml, e.g. at ~/.dobby.toml or ~/.config/dobby/dobby.toml? I don't see a need for it, but I am sure someone will come up with something.
  • Related to the previous one: can settings cascade? Does it make sense for them to do so?

Shadow53 avatar Feb 19 '21 21:02 Shadow53

I'm looking into this and taking an initially naïve approach of recursively checking all parent directories until a knope.toml file is found. I think some of the questions/thoughts in the initial suggestion can be added later as an additional feature.

My questions with the above in mind;

  • Do we want to run the workflow commands from the same directory as the found knope.toml or from the current directory?
  • If there's appetite to support both, I assume we'll need some kind've configuration for the Command workflow step to be able to switch between the two, or perhaps a CLI argument to switch between the default and non-default option?

alex-way avatar Mar 19 '24 18:03 alex-way