onehealth/preprocess — pull request #17 by CMTegner (2013-07-22 18:33:46+00:00)
Title: Detect if included file exists

The current implementation of the `include` replacement doesn't check if the file actually exists or not when returning the " not found" message, it simply checks if the file content is truthy or not.

This change uses `fs.existsSync()` to check if the file exists - returning " not found" if it isn't - before processing and injecting the contents (empty or not) into the file.