coala/coala-html

coala_html.py: Bug in os.walk approach to detect empty directory

tushar-rishav opened this issue · 1 comments

At present we are detecting if a directory is an empty before copying the angular package at coala_html.py, L38. This approach is faulty as for an empty directory len(list(os.walk(<empty_dir>))) will be 1. Instead, I have better solution.Since we already know the content of the target directory, we can just check if any particular file e.g index.html is present or not. I believe this approach is more efficient than traversing the directories recursively. -> Bad approach. See more at #84

Thanks for reporting this issue!

@coala-analyzer/coala-contributors, your aid is required, fellow coalaian. Help us triage and solving this issue!