mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(package) add checkup back
This commit is contained in:
parent
0ebc50479c
commit
3fd5ad8682
3 changed files with 9 additions and 16 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);
|
||||
|
||||
assert('callback');
|
||||
check([callback], ['callback']);
|
||||
|
||||
if (data)
|
||||
fs.writeFile(ConfigHome, data, callback);
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
}
|
||||
|
||||
function socket(sock) {
|
||||
assert('socket');
|
||||
check([sock], ['socket']);
|
||||
|
||||
sock.of('/config')
|
||||
.on('connection', function(socket) {
|
||||
|
|
@ -180,4 +180,4 @@
|
|||
json.password = password(algo, json.password);
|
||||
}
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
DIR_JSON = DIR_LIB + '../json/',
|
||||
|
||||
path = require('path'),
|
||||
assert = require('assert'),
|
||||
root = require(DIR + 'root'),
|
||||
config = require(DIR + 'config'),
|
||||
binom = require(DIR + 'binom'),
|
||||
|
|
@ -32,19 +31,12 @@
|
|||
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
|
||||
*
|
||||
|
|
@ -59,7 +51,7 @@
|
|||
response : response
|
||||
};
|
||||
|
||||
check(request, response, next);
|
||||
check(arguments, ['request', 'response', 'next']);
|
||||
|
||||
apiURL = CloudFunc.apiURL;
|
||||
name = ponse.getPathName(request);
|
||||
|
|
@ -178,7 +170,7 @@
|
|||
function onPUT(name, body, callback) {
|
||||
var cmd, files, data, from, to, msg;
|
||||
|
||||
check(name, body, callback);
|
||||
check(arguments, ['name', 'body', 'callback']);
|
||||
|
||||
if (name[0] === '/')
|
||||
cmd = name.replace('/', '');
|
||||
|
|
@ -334,7 +326,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
check(files, processFunc, callback);
|
||||
check(arguments, ['files', 'processFunc', 'callback']);
|
||||
|
||||
copy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
},
|
||||
"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