mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
minor changes
This commit is contained in:
parent
308e381d3e
commit
aba916e5e8
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