Skip to content

Commit

Permalink
Added fs.existsSync fallback to get rid of 0.8 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubpawlowicz committed Aug 2, 2012
1 parent 7e4eafa commit 5c5b1a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/assets.js
@@ -1,6 +1,7 @@
var fs = require('fs'),
path = require('path'),
yaml = require('../vendor/yaml');
yaml = require('../vendor/yaml'),
existsSync = fs.existsSync || path.existsSync;

var AssetsExpander = function(pathToYaml, options) {
if (!pathToYaml) return;
Expand Down Expand Up @@ -46,7 +47,7 @@ AssetsExpander.prototype = {
});
} else {
var expanded = path.join(root, asset) + '.' + options.type;
if (path.existsSync(expanded)) matches.push(expanded);
if (existsSync(expanded)) matches.push(expanded);
}

return matches;
Expand Down

0 comments on commit 5c5b1a3

Please sign in to comment.