Permalink
Browse files

fix node 0.6.0 compat mode for {fs,path}.exists(Sync)

  • Loading branch information...
1 parent 0d882ad commit 3d69d637a0ce3584218585db45d2417e3819d67b @xaiki xaiki committed with ozten Dec 14, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/i18n.js
View
@@ -48,6 +48,8 @@ exports.abide = function (options) {
if (! options.i18n_json_dir) options.i18n_json_dir = 'resources/static/i18n/';
if (! options.logger) options.logger = console;
+ var exists = fs.existsSync || path.existsSync;
+
var logger = options.logger;
var mo_file_path = function (locale) {
@@ -68,8 +70,8 @@ exports.abide = function (options) {
default_locale = localeFrom(options.default_lang);
mo_cache[l] = {
- mo_exists: path.existsSync(mo_file_path(l)),
- /* json_exists: path.existsSync(json_file_path(l)), */
+ mo_exists: path.exists(mo_file_path(l)),
+ /* json_exists: path.exists(json_file_path(l)), */
gt: null
};
if (l !== debug_locale) {

0 comments on commit 3d69d63

Please sign in to comment.