Closed pp3345 closed 5 years ago
This is probably the ugliest bash command I've ever written, but it works :man_shrugging:
Looking at this again, I am an idiot. Here is a much simpler and saner solution.
For reference, the previous approach was
pylint --reports=n *.py $(find -type d \( -path "./frontend*" -o -path "./edid_parser*" \) -exec sh -c 'ls -1 {}/*.py 2> /dev/null | (test $(wc -l) -gt 0 && echo {})' ';' | awk '{ print $1 "/*.py" }')
I think you want something like this
$(find ./frontend* ./edid_parser* -type f -and -name \*.py -and -not -empty)
I think the current solution is okay, what do you think? Requiring shopt
is a bit unfurtonate, but apart from that... If you prefer using find
I am okay with that, too, of course.
One find command is superior to one find command + ls + awk...
Oh - I didn't see the shopt
change...
This implements a variation of @mithro's suggestion from https://github.com/timvideos/edid.tv/pull/28