mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactor(dir) rm main
This commit is contained in:
parent
01a3362313
commit
67f25439be
1 changed files with 19 additions and 16 deletions
|
|
@ -2,28 +2,31 @@
|
|||
(function(){
|
||||
'use strict';
|
||||
|
||||
if(!global.cloudcmd)
|
||||
return console.log(
|
||||
'# dir.js' + '\n' +
|
||||
'# -----------' + '\n' +
|
||||
'# Module is part of Cloud Commander,' + '\n' +
|
||||
'# used for getting dir size.' + '\n' +
|
||||
'# If you wont to see at work' + '\n' +
|
||||
'# try GET /api/v1/fs/etc?size or' + '\n' +
|
||||
'# dir.getSize(\'/etc, function(err, size) {' + '\n' +
|
||||
'# });' + '\n' +
|
||||
'# http://cloudcmd.io' + '\n');
|
||||
|
||||
|
||||
/*
|
||||
'# dir.js' + '\n' +
|
||||
'# -----------' + '\n' +
|
||||
'# Module is part of Cloud Commander,' + '\n' +
|
||||
'# used for getting dir size.' + '\n' +
|
||||
'# If you wont to see at work' + '\n' +
|
||||
'# try GET /api/v1/fs/etc?size or' + '\n' +
|
||||
'# dir.getSize(\'/etc, function(err, size) {' + '\n' +
|
||||
'# });' + '\n' +
|
||||
'# http://cloudcmd.io' + '\n');
|
||||
*/
|
||||
|
||||
var main = global.cloudcmd.main,
|
||||
fs = main.fs,
|
||||
Util = main.util,
|
||||
path = main.path,
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
|
||||
Util = require('../util'),
|
||||
|
||||
/* The lstat() function shall be equivalent to stat(),
|
||||
except when path refers to a symbolic link. In that case lstat()
|
||||
shall return information about the link, while stat() shall return
|
||||
information about the file the link references.
|
||||
*/
|
||||
stat = fs.lstat.bind(fs);
|
||||
stat = fs.lstat;
|
||||
|
||||
exports.isDir = function(name, callback) {
|
||||
name += '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue