MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / processPublicCommand

Function processPublicCommand

main.js:3641–3713  ·  view source on GitHub ↗
(botId, bot, msg, command, commandArgs)

Source from the content-addressed store, hash-verified

3639 }
3640 };
3641 task.logPublicly = (message) => {
3642 task.logPrivately(message);
3643 message = escapeHtml(trimIndent(message).trim());
3644 if (message) {
3645 task.publicLog.push(message);
3646 build.updateMessage();
3647 }
3648 };
3649 const onDone = (code, signal) => {
3650 if (task.endTime)
3651 return;
3652 console.log('Done task ' + task.name + ' with code ' + code + ' signal ' + signal);
3653 if (code != 0 && task.privateLog) {
3654 console.log('Private task ' + task.name + ' log:\n' + task.privateLog.join('\n'));
3655 }
3656 task.endTime = new Date();
3657 task.process = null;
3658 task.exitCode = code;
3659 task.error = code != 0;
3660 if (task.error) {
3661 build.error = true;
3662 }
3663 task.finished = !task.error;
3664 build.updateMessage();
3665 traceDuration('task_stat', task.name, task.startTime, task.endTime, task.finished);
3666 build.step();
3667 };
3668 if (task.cmd || task.script) {
3669 if (task.script) {
3670 const args = task.args ? [task.script, ...task.args] : [task.script];
3671 console.log('Running script', task.script);
3672 task.process = spawn('/bin/bash', args, {cwd: settings.TGX_SOURCE_PATH});
3673 } else {
3674 const command = task.cmd + (task.args ? ' ' + task.args.join(' ') : '');
3675 console.log('Executing bash -c', task.description || '...');
3676 task.process = spawn('/bin/bash', ['-c', command], {cwd: settings.TGX_SOURCE_PATH});
3677 }
3678 task.process.stdout.on('data', (data) => {
3679 if (!task.silence || LOCAL) {
3680 console.log(`${data}`);
3681 }
3682 });
3683 task.process.stderr.on('data', (data) => {
3684 if (task.silence) {
3685 console.error(`${data}`);
3686 } else {
3687 task.logPrivately(`${data}`);
3688 }
3689 });
3690 task.process.on('close', onDone);
3691 } else {
3692 task.cancel = task.act(task, onDone);
3693 }
3694
3695 build.updateMessage();
3696 if (task.isAsync) {
3697 havePendingAsyncTasks = true;
3698 continue;

Callers 1

messageCallbackFunction · 0.85

Calls 5

globalErrorHandlerFunction · 0.85
matchChecksumFunction · 0.85
findApkByHashFunction · 0.85
getChecksumMessageFunction · 0.85
welcomeFunction · 0.85

Tested by

no test coverage detected