joshrotenberg / adrs

Architectural Decision Record tool in Rust
http://joshrotenberg.com/adrs/
Apache License 2.0
17 stars 4 forks source link

enhancement(adr-dir): make finding the adr-dir more intuitive #5

Open joshrotenberg opened 5 months ago

joshrotenberg commented 5 months ago

adr-tools creates the .adr-dir file on init and then uses that for subsequent runs to decide where to put/get ADRs. This works fine, and I've reproduced this behavior in adrs, but I think it would be cleaner to use a global flag tied to an environment variable, as well as just use the docs/adr as a default everywhere.

The flow would be something like this:

I think this covers most potential situations while maintaining backwards compatibility and keeping sane defaults.

Steps off the top of my head:

  1. Add the directory flag in main.rs as a global flag, with the env marker to also pull it from the environment.
  2. Process the flag before calling the subcommand, and pass the directory value to any subcommand as a Path (or maybe PathBuf?).
  3. Change anything that uses .adr-dir now to always use that value.
joshrotenberg commented 5 months ago

Also, it probably makes sense to actually write ADRs for things that diverge from adr-tools functionality since this is, like, a tool for ADRs.