mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(root) rm path
This commit is contained in:
parent
cb4d00828c
commit
ab407b22bd
1 changed files with 1 additions and 8 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue