add dir/file check.
Merge branch 'fix-gen-index-html'