mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
minor changes
This commit is contained in:
parent
272d5a22fd
commit
4c56e5fb7d
1 changed files with 4 additions and 5 deletions
|
|
@ -20,6 +20,9 @@ exports.listen = function(pServer){
|
|||
socket.on('message', function(pCommand) {
|
||||
console.log(pCommand);
|
||||
|
||||
if(process.platform === 'win32')
|
||||
pCommand = 'chcp 65001 |' + pCommand;
|
||||
|
||||
exec(pCommand, getExec);
|
||||
});
|
||||
|
||||
|
|
@ -35,14 +38,10 @@ exports.listen = function(pServer){
|
|||
*/
|
||||
function getExec(error, stdout, stderr) {
|
||||
if(stdout){
|
||||
stdout = stdout.toString('utf-8');
|
||||
|
||||
console.log(stdout);
|
||||
Socket.send(stdout);
|
||||
}
|
||||
if(stderr){
|
||||
stderr = stderr.toString('utf-8');
|
||||
|
||||
if(stderr){
|
||||
console.log('stderr: ' + stderr);
|
||||
Socket.send(stderr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue