pull/310/head
Frostebite 2021-12-26 01:05:51 +00:00
parent 37eca535ea
commit ec47228d09
3 changed files with 19 additions and 7 deletions

12
dist/index.js vendored
View File

@ -492,7 +492,8 @@ class RemoteClientSystem {
static Run(command) { static Run(command) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
return yield new Promise((promise) => { 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) { if (error) {
cloud_runner_logger_1.default.logRemoteCli(`[ERROR] ${error.message}`); cloud_runner_logger_1.default.logRemoteCli(`[ERROR] ${error.message}`);
throw new Error(error.toString()); throw new Error(error.toString());
@ -501,8 +502,13 @@ class RemoteClientSystem {
cloud_runner_logger_1.default.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`); cloud_runner_logger_1.default.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`);
throw new Error(stderr.toString()); throw new Error(stderr.toString());
} }
cloud_runner_logger_1.default.logRemoteCli(`${stdout.toString()}`); const outputChunk = `${stdout.toString()}`;
promise(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);
});
}); });
}); });
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,8 @@ import CloudRunnerLogger from '../../cloud-runner/services/cloud-runner-logger';
export class RemoteClientSystem { export class RemoteClientSystem {
public static async Run(command: string) { public static async Run(command: string) {
return await new Promise<string>((promise) => { return await new Promise<string>((promise) => {
exec(command, (error, stdout, stderr) => { let output = '';
const child = exec(command, (error, stdout, stderr) => {
if (error) { if (error) {
CloudRunnerLogger.logRemoteCli(`[ERROR] ${error.message}`); CloudRunnerLogger.logRemoteCli(`[ERROR] ${error.message}`);
throw new Error(error.toString()); throw new Error(error.toString());
@ -13,8 +14,13 @@ export class RemoteClientSystem {
CloudRunnerLogger.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`); CloudRunnerLogger.logRemoteCli(`[STD-ERROR] ${stderr.toString()}`);
throw new Error(stderr.toString()); throw new Error(stderr.toString());
} }
CloudRunnerLogger.logRemoteCli(`${stdout.toString()}`); const outputChunk = `${stdout.toString()}`;
promise(stdout.toString()); CloudRunnerLogger.logRemoteCli(outputChunk);
output += outputChunk;
child.on('close', function (code) {
CloudRunnerLogger.logRemoteCli(`${code}`);
promise(output);
});
}); });
}); });
} }