test
parent
e57af53dab
commit
ca23c2c303
|
|
@ -492,19 +492,21 @@ 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) => {
|
||||||
var _a, _b;
|
|
||||||
let output = '';
|
let output = '';
|
||||||
const child = child_process_1.exec(command);
|
const child = child_process_1.exec(command, (error, stdout, stderr) => {
|
||||||
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', function (data) {
|
if (error) {
|
||||||
const outputChunk = `${data}`;
|
cloud_runner_logger_1.default.logRemoteCli(`[ERROR] ${error.message}`);
|
||||||
|
throw new Error(error.toString());
|
||||||
|
}
|
||||||
|
if (stderr) {
|
||||||
|
cloud_runner_logger_1.default.logRemoteCli(`[STD-E/DIAG] ${stderr.toString()}`);
|
||||||
|
}
|
||||||
|
const outputChunk = `${stdout.toString()}`;
|
||||||
cloud_runner_logger_1.default.logRemoteCli(outputChunk);
|
cloud_runner_logger_1.default.logRemoteCli(outputChunk);
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
});
|
});
|
||||||
(_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on('data', function (data) {
|
|
||||||
cloud_runner_logger_1.default.logRemoteCli(`[STD-ERROR] ${data}`);
|
|
||||||
});
|
|
||||||
child.on('close', function (code) {
|
child.on('close', function (code) {
|
||||||
cloud_runner_logger_1.default.logRemoteCli(`${code} `);
|
cloud_runner_logger_1.default.logRemoteCli(`${code}`);
|
||||||
promise(output);
|
promise(output);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -5,17 +5,20 @@ 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) => {
|
||||||
let output = '';
|
let output = '';
|
||||||
const child = exec(command);
|
const child = exec(command, (error, stdout, stderr) => {
|
||||||
child.stdout?.on('data', function (data) {
|
if (error) {
|
||||||
const outputChunk = `${data}`;
|
CloudRunnerLogger.logRemoteCli(`[ERROR] ${error.message}`);
|
||||||
|
throw new Error(error.toString());
|
||||||
|
}
|
||||||
|
if (stderr) {
|
||||||
|
CloudRunnerLogger.logRemoteCli(`[STD-E/DIAG] ${stderr.toString()}`);
|
||||||
|
}
|
||||||
|
const outputChunk = `${stdout.toString()}`;
|
||||||
CloudRunnerLogger.logRemoteCli(outputChunk);
|
CloudRunnerLogger.logRemoteCli(outputChunk);
|
||||||
output += outputChunk;
|
output += outputChunk;
|
||||||
});
|
});
|
||||||
child.stderr?.on('data', function (data) {
|
|
||||||
CloudRunnerLogger.logRemoteCli(`[STD-ERROR] ${data}`);
|
|
||||||
});
|
|
||||||
child.on('close', function (code) {
|
child.on('close', function (code) {
|
||||||
CloudRunnerLogger.logRemoteCli(`${code} `);
|
CloudRunnerLogger.logRemoteCli(`${code}`);
|
||||||
promise(output);
|
promise(output);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue