Skip to content

Commit

Permalink
don't read file async, need to know if it's there so catch exception …
Browse files Browse the repository at this point in the history
…instead
  • Loading branch information
robb1e committed Sep 23, 2010
1 parent 1e8ff97 commit b455845
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/properties.js
@@ -1,11 +1,12 @@
var fs = require('fs'); var fs = require('fs');


var baseProperties = __dirname + '/properties/build.properties'; var baseProperties = __dirname + '/../../properties/build.json';
var properties = {}; var properties = {};


path.exists(baseProperties, function(exists){ try {
if (exists) properties = JSON.parse(fs.readFileSync(baseProperties, 'utf8'));
properties = JSON.parse(fs.readFileSync(baseProperties, 'utf8')); } catch (err){
}); console.log(err);
}


module.exports = properties; module.exports = properties;

0 comments on commit b455845

Please sign in to comment.