npryce / adr-tools

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

Make adr files recognition more stringent #107

Closed davebaol closed 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 -exec basename {} \; | grep -E '^[0-9]*[1-9][0-9]*-[^/]*\.md$' | sort | sed -e "s?^?$adr_dir/?"

Explanation: