Permalink
Browse files

don't read file async, need to know if it's there so catch exception …

…instead
  • Loading branch information...
1 parent 1e8ff97 commit b455845d46ed6334e8ad33c2432a3f1bfc2e8170 @robb1e robb1e committed Sep 23, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/properties.js
View
@@ -1,11 +1,12 @@
var fs = require('fs');
-var baseProperties = __dirname + '/properties/build.properties';
+var baseProperties = __dirname + '/../../properties/build.json';
var properties = {};
-path.exists(baseProperties, function(exists){
- if (exists)
- properties = JSON.parse(fs.readFileSync(baseProperties, 'utf8'));
-});
+try {
+ properties = JSON.parse(fs.readFileSync(baseProperties, 'utf8'));
+} catch (err){
+ console.log(err);
+}
module.exports = properties;

0 comments on commit b455845

Please sign in to comment.