mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
22 lines
509 B
JavaScript
22 lines
509 B
JavaScript
(function() {
|
|
'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);
|
|
|
|
return dir;
|
|
};
|
|
})();
|