npryce / adr-tools

Command-line tools for working with Architecture Decision Records
Other
4.53k stars 578 forks source link

Make adr files recognition stricter #108

Open davebaol opened 3 years ago

davebaol commented 3 years ago

This fix makes adr list and adr link work properly when there are extraneous files along with adr files.

I just changed

find $adr_dir | grep -E "^$adr_dir/[0-9]+-[^/]*\\.md" | sort

to

find $adr_dir -maxdepth 1 -type f | grep -E "^.{${#adr_dir}}/[0-9]*[1-9][0-9]*-[^/]*\\.md$" | sort

Explanation: