mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
feature(root) add condition dir and root
This commit is contained in:
parent
d6e9fa7c88
commit
7c46655843
1 changed files with 6 additions and 3 deletions
|
|
@ -10,10 +10,13 @@
|
|||
module.exports = function(dir) {
|
||||
var root = config('root') || '/';
|
||||
|
||||
if (root === '/' && dir !== '/')
|
||||
dir = mellow.pathToWin(dir);
|
||||
if (dir === '/')
|
||||
dir = root;
|
||||
else
|
||||
dir = path.join(root, dir);
|
||||
if (root === '/')
|
||||
dir = mellow.pathToWin(dir);
|
||||
else
|
||||
dir = path.join(root, dir);
|
||||
|
||||
log(dir);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue