test
parent
37eca535ea
commit
ec47228d09
|
|
@ -492,7 +492,8 @@ class RemoteClientSystem {
|
|||
static Run(command) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield new Promise((promise) => {
|
||||
child_process_1.exec(command, (error, stdout, stderr) => {
|
||||
let output = '';
|
||||
const child = child_process_1.exec(command, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
cloud_runner_logger_1.default.logRemoteCli(`[ERROR] ${error.message}`);
|
||||
throw new Error(error.toString());
|
||||
|
|
@ -501,8 +502,13 @@ class RemoteClientSystem {
|
|||
cloud_runner_logger_1.default.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`);
|
||||
throw new Error(stderr.toString());
|
||||
}
|
||||
cloud_runner_logger_1.default.logRemoteCli(`${stdout.toString()}`);
|
||||
promise(stdout.toString());
|
||||
const outputChunk = `${stdout.toString()}`;
|
||||
cloud_runner_logger_1.default.logRemoteCli(outputChunk);
|
||||
output += outputChunk;
|
||||
child.on('close', function (code) {
|
||||
cloud_runner_logger_1.default.logRemoteCli(`${code}`);
|
||||
promise(output);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,8 @@ import CloudRunnerLogger from '../../cloud-runner/services/cloud-runner-logger';
|
|||
export class RemoteClientSystem {
|
||||
public static async Run(command: string) {
|
||||
return await new Promise<string>((promise) => {
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
let output = '';
|
||||
const child = exec(command, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
CloudRunnerLogger.logRemoteCli(`[ERROR] ${error.message}`);
|
||||
throw new Error(error.toString());
|
||||
|
|
@ -13,8 +14,13 @@ export class RemoteClientSystem {
|
|||
CloudRunnerLogger.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`);
|
||||
throw new Error(stderr.toString());
|
||||
}
|
||||
CloudRunnerLogger.logRemoteCli(`${stdout.toString()}`);
|
||||
promise(stdout.toString());
|
||||
const outputChunk = `${stdout.toString()}`;
|
||||
CloudRunnerLogger.logRemoteCli(outputChunk);
|
||||
output += outputChunk;
|
||||
child.on('close', function (code) {
|
||||
CloudRunnerLogger.logRemoteCli(`${code}`);
|
||||
promise(output);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue