Skip to content

Commit

Permalink
Fix expose version
Browse files Browse the repository at this point in the history
  • Loading branch information
biggora committed Feb 20, 2013
1 parent 61506ba commit 6ec3c9a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ exports.__defineGetter__('BaseSQL', function () {
});

exports.init = function (rw) {
if (typeof rw === 'string') {
railway.orm = exports;
if (global.railway) {
global.railway.orm = exports;
} else {
rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass};
}
require('./lib/railway')(rw);
var railway = './lib/railway';
require(railway)(rw);
};

try {
if (process.versions.node < '0.6') {
exports.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version;
} else {
exports.version = require('../package').version;
exports.version = require('./package').version;
}
} catch (e) {}

Expand Down

0 comments on commit 6ec3c9a

Please sign in to comment.