mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
feature(package) rm checkup
This commit is contained in:
parent
8a5c56db84
commit
f7b42a3ee9
3 changed files with 15 additions and 8 deletions
|
|
@ -11,12 +11,12 @@
|
|||
HOME = (HOME_UNIX || HOME_WIN) + '/',
|
||||
|
||||
fs = require('fs'),
|
||||
assert = require('assert'),
|
||||
|
||||
password = require(DIR_SERVER + 'password'),
|
||||
Util = require(DIR_LIB + 'util'),
|
||||
CloudFunc = require(DIR_LIB + 'cloudfunc'),
|
||||
|
||||
check = require('checkup'),
|
||||
tryCatch = require('try-catch'),
|
||||
pipe = require('pipe-io'),
|
||||
ponse = require('ponse'),
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
function save(callback) {
|
||||
var data = jonny.stringify(config, 0, 4);
|
||||
|
||||
check(arguments, ['callback']);
|
||||
assert('callback');
|
||||
|
||||
if (data)
|
||||
fs.writeFile(ConfigHome, data, callback);
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
}
|
||||
|
||||
function socket(sock) {
|
||||
check(arguments, ['socket']);
|
||||
assert('socket');
|
||||
|
||||
sock.of('/config')
|
||||
.on('connection', function(socket) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
DIR_JSON = DIR_LIB + '../json/',
|
||||
|
||||
path = require('path'),
|
||||
assert = require('assert'),
|
||||
root = require(DIR + 'root'),
|
||||
config = require(DIR + 'config'),
|
||||
binom = require(DIR + 'binom'),
|
||||
|
|
@ -31,12 +32,19 @@
|
|||
rendy = require('rendy'),
|
||||
copymitter = require('copymitter'),
|
||||
json = require('jonny'),
|
||||
check = require('checkup'),
|
||||
|
||||
Modules = require(DIR_JSON + 'modules'),
|
||||
|
||||
isWin32 = process.platform === 'win32';
|
||||
|
||||
function check() {
|
||||
var i,
|
||||
n = arguments.length;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
assert(arguments[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* rest interface
|
||||
*
|
||||
|
|
@ -51,7 +59,7 @@
|
|||
response : response
|
||||
};
|
||||
|
||||
check(arguments, ['request', 'response', 'next']);
|
||||
check(request, response, next);
|
||||
|
||||
apiURL = CloudFunc.apiURL;
|
||||
name = ponse.getPathName(request);
|
||||
|
|
@ -170,7 +178,7 @@
|
|||
function onPUT(name, body, callback) {
|
||||
var cmd, files, data, from, to, msg;
|
||||
|
||||
check(arguments, ['name', 'body', 'callback']);
|
||||
check(name, body, callback);
|
||||
|
||||
if (name[0] === '/')
|
||||
cmd = name.replace('/', '');
|
||||
|
|
@ -326,7 +334,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
check(arguments, ['files', 'processFunc', 'callback']);
|
||||
check(files, processFunc, callback);
|
||||
|
||||
copy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
},
|
||||
"subdomain": "cloudcmd",
|
||||
"dependencies": {
|
||||
"checkup": "~1.0.3",
|
||||
"console-io": "~2.2.0",
|
||||
"copymitter": "~1.8.0",
|
||||
"dword": "~1.5.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue