mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 07:57:40 +00:00
Reduce script logging suppressions and Feishu any casts
This commit is contained in:
@@ -3,6 +3,10 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { homedir } from "node:os";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
function writeStdoutLine(message = ""): void {
|
||||
process.stdout.write(`${message}\n`);
|
||||
}
|
||||
|
||||
const BUG_LABEL = "bug";
|
||||
const ENHANCEMENT_LABEL = "enhancement";
|
||||
const SUPPORT_LABEL = "r: support";
|
||||
@@ -231,25 +235,20 @@ function parseArgs(argv: string[]): ScriptOptions {
|
||||
}
|
||||
|
||||
function logHeader(title: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n${title}`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("=".repeat(title.length));
|
||||
writeStdoutLine(`\n${title}`);
|
||||
writeStdoutLine("=".repeat(title.length));
|
||||
}
|
||||
|
||||
function logStep(message: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`• ${message}`);
|
||||
writeStdoutLine(`• ${message}`);
|
||||
}
|
||||
|
||||
function logSuccess(message: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`✓ ${message}`);
|
||||
writeStdoutLine(`✓ ${message}`);
|
||||
}
|
||||
|
||||
function logInfo(message: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(` ${message}`);
|
||||
writeStdoutLine(` ${message}`);
|
||||
}
|
||||
|
||||
function createEmptyState(): LoadedState {
|
||||
@@ -748,8 +747,7 @@ async function main() {
|
||||
logInfo(`Processing ${pendingIssues.length} issues (scanned so far: ${scannedCount}).`);
|
||||
|
||||
for (const issue of pendingIssues) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n#${issue.number} — ${issue.title}`);
|
||||
writeStdoutLine(`\n#${issue.number} — ${issue.title}`);
|
||||
|
||||
const labels = new Set(issue.labels.map((label) => label.name));
|
||||
logInfo(`Existing labels: ${Array.from(labels).toSorted().join(", ") || "none"}`);
|
||||
@@ -824,8 +822,7 @@ async function main() {
|
||||
);
|
||||
|
||||
for (const pullRequest of pendingPullRequests) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n#${pullRequest.number} — ${pullRequest.title}`);
|
||||
writeStdoutLine(`\n#${pullRequest.number} — ${pullRequest.title}`);
|
||||
|
||||
const labels = new Set(pullRequest.labels.map((label) => label.name));
|
||||
logInfo(`Existing labels: ${Array.from(labels).toSorted().join(", ") || "none"}`);
|
||||
|
||||
Reference in New Issue
Block a user