feature(terminal) add info if pty not installed

This commit is contained in:
coderaiser 2014-02-05 09:20:17 -05:00
parent 4e8c524dcb
commit a507c32f4c

View file

@ -20,20 +20,33 @@
CHANNEL = CloudFunc.CHANNEL_TERMINAL,
CHANNEL_RESIZE = CloudFunc.CHANNEL_TERMINAL_RESIZE,
ConNum = 0;
ConNum = 0,
INFO = 'to use terminal install pty.js: npm i pty.js';
/**
* function listen on servers port
* @pServer {Object} started server object
*/
exports.init = function() {
var ret;
if (pty)
ret = socket.on('connection', function(clientSocket) {
var ret, func,
makePty = function(clientSocket) {
onConnection(clientSocket, function(channel, data) {
socket.emit(channel, data, clientSocket);
});
});
},
sendInfo = function(clientSocket) {
Util.log(INFO);
socket.emit(CHANNEL, INFO, clientSocket);
};
if (pty)
func = makePty;
else
func = sendInfo;
ret = socket.on('connection', func);
return ret;
};