sunng87 / handlebars-iron

Handlebars middleware for Iron web framework
MIT License
119 stars 20 forks source link

Glob matching fails silently on non-existing dir #4

Closed golddranks closed 9 years ago

golddranks commented 9 years ago

When setting a non-existing directory for the prefix, I think it would be desirable that glob matching would panic and report the error. I just noticed that it fails silently, since I ran cargo run inside src/ whereas I usually run it from the cargo root dir.

I also thought that it would be maybe nice to change glob to std::fs::WalkDir iterator to eliminate a dependency, but that is marked as unstable, and I don't know whether it'll stabilise until the 1.0 beta. But what do you think about using it when it stabilises?

sunng87 commented 9 years ago

Thanks for reporting! I will definitely add a check for prefix directory.

std::fs::WalkDir should be better than glob in our use case. It's beta but I think it's OK to use it our library. Pull request for this is welcomed.

sunng87 commented 9 years ago

fs_walk now in master.