feature(root) rm path

This commit is contained in:
coderaiser 2015-04-08 03:20:10 -04:00
parent cb4d00828c
commit ab407b22bd

View file

@ -2,20 +2,13 @@
'use strict';
var DIR = './',
path = require('path'),
config = require(DIR + 'config'),
mellow = require('mellow');
module.exports = function(dir) {
var root = config('root') || '/';
if (dir === '/')
dir = root;
else
if (root === '/')
dir = mellow.pathToWin(dir);
else
dir = path.join(root, dir);
dir = mellow.pathToWin(dir, root);
return dir;
};