🐎 Use fs.statSyncNoException in coffee-cache

This commit is contained in:
Kevin Sawicki
2013-10-02 18:17:46 -07:00
parent 80b4572190
commit 80e4e5f2cd

View File

@@ -15,8 +15,9 @@ getCachePath = (coffee) ->
path.join(coffeeCacheDir, "#{digest}.coffee")
getCachedJavaScript = (cachePath) ->
try
fs.readFileSync(cachePath, 'utf8') if fs.statSync(cachePath).isFile()
if stat = fs.statSyncNoException(cachePath)
try
fs.readFileSync(cachePath, 'utf8') if stat.isFile()
compileCoffeeScript = (coffee, filePath, cachePath) ->
js = CoffeeScript.compile(coffee, filename: filePath)