refactor(console) addNewLine

This commit is contained in:
coderaiser 2014-05-27 09:47:31 -04:00
parent 70b9288f15
commit 8a562f7b7a

View file

@ -20,6 +20,9 @@
ClientDirs = [],
Clients = [],
WIN32 = main.WIN32,
addNewLine = CloudFunc.addNewLine,
ConNum = 0,
CHANNEL = CloudFunc.CHANNEL_CONSOLE,
@ -71,7 +74,7 @@
msg = log(ConNum, 'console connected');
Util.exec(callback, {
stdout : msg
stdout : addNewLine(msg)
});
Clients[ConNum] = true;
@ -166,7 +169,7 @@
if (firstChar === '#') {
command = command.slice(1);
command = connName + command;
command = CloudFunc.addNewLine(command);
command = addNewLine(command);
Util.exec(callback, {
stdout: command
@ -188,7 +191,7 @@
errorStr = stderr || error;
if (errorStr)
errorStr = CloudFunc.addNewLine(errorStr + '');
errorStr = addNewLine(errorStr + '');
json = {
stdout : stdout,
@ -228,8 +231,7 @@
cmd.stderr.on('data', sendError);
cmd.on('error', function(error) {
var addNewLine = CloudFunc.addNewLine,
errorStr = addNewLine(error + '');
var errorStr = addNewLine(error + '');
Util.log(error);
sendError(errorStr);
@ -257,7 +259,7 @@
update.get();
Util.exec(callback, {
stdout: CloudFunc.addNewLine('update: ok')
stdout: addNewLine('update: ok')
});
}