@kaynooo/cli-forgejo 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +137 -80
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Needs [tea](https://gitea.com/gitea/tea) logged in to the Forgejo instance (`tea
|
|
|
29
29
|
| `ft close <n>... [-m reason]` | closes issues no commit fixed (a duplicate, one dropped), posting the reason first; `ft reopen` reopens them the same way |
|
|
30
30
|
| `ft label <n> [+]a -b` | adds the labels named bare or with `+`, removes those named with `-`, refusing one the repository lacks, and prints the issue's labels |
|
|
31
31
|
| `ft plan add <plan> <n>...` / `ft plan carry <from> <to>` | adds `- [ ] #<n> <title>` lines to a release plan's checklist, or copies one plan's unticked `#<n>` lines into the next, both under `--section "Bugs:"` (created when missing) and skipping issues already listed |
|
|
32
|
-
| `ft milestones` | lists the milestones (`--state open\|closed\|all`, `--json`) with the issues open and closed in each, the progress and the due date |
|
|
32
|
+
| `ft milestones` | lists the milestones (`--state open\|closed\|all`, `--json`, `--issues` for each one's issues by title) with the issues open and closed in each, the progress and the due date |
|
|
33
33
|
| `ft milestone <title\|id>` | shows a milestone's open issues as `ft board` does (available, taken, claimed by one gone); `ft milestone new <title> [-d text] [--due YYYY-MM-DD]` creates one through the API, sending no `due_on` unless `--due` is given, never a zero date; `ft milestone close <m>` refuses while issues are open in it, naming them, unless `--force` |
|
|
34
34
|
| `ft remote [--fix]` | switches an origin using an ssh alias (`forgejo:owner/repo`) to `git@<host>:owner/repo.git`, which tea matches; the host comes from `--host` or `remoteHost` in `~/.config/kaynooo-cli/ft.json` (`{"remoteHost": "git.example.com"}`; the older `~/.config/ft/config.json` is read while the new file is missing), and with neither it checks nothing |
|
|
35
35
|
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
// src/cli.ts
|
|
5
|
-
import
|
|
5
|
+
import process28 from "process";
|
|
6
6
|
// ../kit/src/args.ts
|
|
7
7
|
import process10 from "process";
|
|
8
8
|
import { parseArgs } from "util";
|
|
@@ -668,6 +668,9 @@ function jsonText(value, replacer, { stream = process7.stdout, env = process7.en
|
|
|
668
668
|
function printJson(value) {
|
|
669
669
|
console.log(jsonText(value));
|
|
670
670
|
}
|
|
671
|
+
function formatPercent(ratio, digits = 0) {
|
|
672
|
+
return `${(ratio * 100).toFixed(digits)}%`;
|
|
673
|
+
}
|
|
671
674
|
|
|
672
675
|
// ../kit/src/help.ts
|
|
673
676
|
import process8 from "process";
|
|
@@ -1000,13 +1003,27 @@ function nearestOption(message, options, allowNegative) {
|
|
|
1000
1003
|
const meant = closest(word, known.map((flag) => flag.replace(DASHES, "")));
|
|
1001
1004
|
return meant === undefined ? undefined : `did you mean ${known.find((flag) => flag.replace(DASHES, "") === meant)}?`;
|
|
1002
1005
|
}
|
|
1006
|
+
// ../kit/src/chart.ts
|
|
1007
|
+
import process11 from "process";
|
|
1008
|
+
var FILLED = "\u2501";
|
|
1009
|
+
var EMPTY = "\u2500";
|
|
1010
|
+
function bar(ratio, { width = 20, stream = process11.stdout, env = process11.env } = {}) {
|
|
1011
|
+
if (outputMode(stream, env) === "agent")
|
|
1012
|
+
return formatPercent(Math.min(1, Math.max(0, ratio)));
|
|
1013
|
+
const colors = paint(stream, env);
|
|
1014
|
+
const filled = Math.round(Math.min(1, Math.max(0, ratio)) * width);
|
|
1015
|
+
if (!takesControlCodes(stream, env))
|
|
1016
|
+
return `${FILLED.repeat(filled)}${EMPTY.repeat(width - filled)}`;
|
|
1017
|
+
const { theme } = activeTheme();
|
|
1018
|
+
return `${tinted(colors, theme.colors.accent, env)(theme.glyphs.bar.repeat(filled))}${colors.dim(theme.glyphs.bar.repeat(width - filled))}`;
|
|
1019
|
+
}
|
|
1003
1020
|
// ../kit/src/progress.ts
|
|
1004
|
-
import
|
|
1021
|
+
import process13 from "process";
|
|
1005
1022
|
|
|
1006
1023
|
// ../kit/src/process.ts
|
|
1007
1024
|
import { constants } from "os";
|
|
1008
1025
|
import { resolve as resolve3 } from "path";
|
|
1009
|
-
import
|
|
1026
|
+
import process12 from "process";
|
|
1010
1027
|
var KILL_GRACE_MS = 2000;
|
|
1011
1028
|
var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
1012
1029
|
var SCHEME = /^[a-z][\w+.-]+:/i;
|
|
@@ -1030,7 +1047,7 @@ function holdSignals(cleanup) {
|
|
|
1030
1047
|
},
|
|
1031
1048
|
release: () => {
|
|
1032
1049
|
for (const signal of SIGNALS)
|
|
1033
|
-
|
|
1050
|
+
process12.off(signal, onSignal);
|
|
1034
1051
|
}
|
|
1035
1052
|
};
|
|
1036
1053
|
function onSignal(signal) {
|
|
@@ -1043,13 +1060,13 @@ function holdSignals(cleanup) {
|
|
|
1043
1060
|
return;
|
|
1044
1061
|
held.release();
|
|
1045
1062
|
cleanup(signal);
|
|
1046
|
-
|
|
1063
|
+
process12.kill(process12.pid, signal);
|
|
1047
1064
|
}
|
|
1048
1065
|
for (const signal of SIGNALS)
|
|
1049
|
-
|
|
1066
|
+
process12.on(signal, onSignal);
|
|
1050
1067
|
return held;
|
|
1051
1068
|
}
|
|
1052
|
-
function openUrl(target, env =
|
|
1069
|
+
function openUrl(target, env = process12.env, platform = process12.platform) {
|
|
1053
1070
|
const opener = env.BROWSER === undefined || env.BROWSER === "" ? OPENERS[platform] ?? ["xdg-open"] : [env.BROWSER];
|
|
1054
1071
|
try {
|
|
1055
1072
|
Bun.spawn([...opener, SCHEME.test(target) ? target : resolve3(target)], { env, stdio: ["ignore", "ignore", "ignore"] }).unref();
|
|
@@ -1086,7 +1103,7 @@ async function runCommand(argv, { cwd, env, stdin = "ignore", timeoutMs, signal,
|
|
|
1086
1103
|
return;
|
|
1087
1104
|
try {
|
|
1088
1105
|
if (grouped)
|
|
1089
|
-
|
|
1106
|
+
process12.kill(-proc.pid, killing);
|
|
1090
1107
|
else
|
|
1091
1108
|
proc.kill(killing);
|
|
1092
1109
|
} catch {}
|
|
@@ -1165,7 +1182,7 @@ var RESET_STYLE = `${ESC}[0m`;
|
|
|
1165
1182
|
var CTRL_C = 3;
|
|
1166
1183
|
var CLOSE_LINK = `${ESC}]8;;${ESC}\\`;
|
|
1167
1184
|
var CONSOLE_METHODS = ["log", "info", "warn", "error", "debug", "dir", "dirxml", "table", "trace", "group", "groupCollapsed", "count", "timeEnd", "timeLog", "assert"];
|
|
1168
|
-
function liveRegion(render, stream =
|
|
1185
|
+
function liveRegion(render, stream = process13.stderr, env = process13.env) {
|
|
1169
1186
|
if (!takesControlCodes(stream, env))
|
|
1170
1187
|
return { redraw: () => {
|
|
1171
1188
|
return;
|
|
@@ -1210,11 +1227,11 @@ function liveRegion(render, stream = process12.stderr, env = process12.env) {
|
|
|
1210
1227
|
clear();
|
|
1211
1228
|
restore();
|
|
1212
1229
|
release();
|
|
1213
|
-
|
|
1230
|
+
process13.off("exit", onExit);
|
|
1214
1231
|
signals.release();
|
|
1215
1232
|
}
|
|
1216
1233
|
timer.unref();
|
|
1217
|
-
|
|
1234
|
+
process13.on("exit", onExit);
|
|
1218
1235
|
return {
|
|
1219
1236
|
redraw: draw,
|
|
1220
1237
|
print: (text) => {
|
|
@@ -1253,14 +1270,14 @@ function cutToWidth(line, width) {
|
|
|
1253
1270
|
return `${kept}${RESET_STYLE}${linked ? CLOSE_LINK : ""}`;
|
|
1254
1271
|
}
|
|
1255
1272
|
function swallowInput() {
|
|
1256
|
-
const input =
|
|
1273
|
+
const input = process13.stdin;
|
|
1257
1274
|
if (!input.isTTY)
|
|
1258
1275
|
return () => {
|
|
1259
1276
|
return;
|
|
1260
1277
|
};
|
|
1261
1278
|
const onData = (data) => {
|
|
1262
1279
|
if (data.includes(CTRL_C))
|
|
1263
|
-
|
|
1280
|
+
process13.kill(process13.pid, "SIGINT");
|
|
1264
1281
|
};
|
|
1265
1282
|
input.setRawMode(true);
|
|
1266
1283
|
input.on("data", onData);
|
|
@@ -1276,7 +1293,7 @@ function swallowInput() {
|
|
|
1276
1293
|
};
|
|
1277
1294
|
}
|
|
1278
1295
|
function interceptOutput(clear) {
|
|
1279
|
-
const targets = [...CONSOLE_METHODS.map((name) => [console, name]), [
|
|
1296
|
+
const targets = [...CONSOLE_METHODS.map((name) => [console, name]), [process13.stdout, "write"], [process13.stderr, "write"]];
|
|
1280
1297
|
const wrapped = targets.map(([target, name]) => {
|
|
1281
1298
|
const original = Reflect.get(target, name);
|
|
1282
1299
|
const wrapper = (...args) => {
|
|
@@ -1295,11 +1312,11 @@ function interceptOutput(clear) {
|
|
|
1295
1312
|
}
|
|
1296
1313
|
|
|
1297
1314
|
// ../kit/src/tool.ts
|
|
1298
|
-
import
|
|
1315
|
+
import process14 from "process";
|
|
1299
1316
|
var PERMANENT = /\bHTTP (?:401|403|404)\b|unauthorized|forbidden|not found|couldn't be found|token is required/i;
|
|
1300
1317
|
function cwdGone() {
|
|
1301
1318
|
try {
|
|
1302
|
-
|
|
1319
|
+
process14.cwd();
|
|
1303
1320
|
return false;
|
|
1304
1321
|
} catch {
|
|
1305
1322
|
return true;
|
|
@@ -1326,7 +1343,7 @@ function isPermanentFailure(error) {
|
|
|
1326
1343
|
async function runTool(label, argv, { timeoutMs, cwd, onStart } = {}) {
|
|
1327
1344
|
let ran;
|
|
1328
1345
|
try {
|
|
1329
|
-
ran = await runCommand(argv, { env:
|
|
1346
|
+
ran = await runCommand(argv, { env: process14.env, ...timeoutMs === undefined ? {} : { timeoutMs }, ...cwd === undefined ? {} : { cwd }, ...onStart === undefined ? {} : { onStart } });
|
|
1330
1347
|
} catch (error) {
|
|
1331
1348
|
throw spawnFailure(label, error);
|
|
1332
1349
|
}
|
|
@@ -1413,13 +1430,13 @@ async function waitForCi(wait) {
|
|
|
1413
1430
|
// ../kit/src/cli.ts
|
|
1414
1431
|
import { readFileSync as readFileSync2, realpathSync } from "fs";
|
|
1415
1432
|
import { dirname as dirname3, join as join5 } from "path";
|
|
1416
|
-
import
|
|
1433
|
+
import process16 from "process";
|
|
1417
1434
|
|
|
1418
1435
|
// ../kit/src/usage.ts
|
|
1419
1436
|
import { appendFileSync, mkdirSync } from "fs";
|
|
1420
1437
|
import { homedir as homedir3 } from "os";
|
|
1421
1438
|
import { dirname as dirname2, isAbsolute, join as join4 } from "path";
|
|
1422
|
-
import
|
|
1439
|
+
import process15 from "process";
|
|
1423
1440
|
|
|
1424
1441
|
// ../kit/src/logs.ts
|
|
1425
1442
|
var DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -1433,14 +1450,14 @@ var usageError;
|
|
|
1433
1450
|
function noteUsageError(message) {
|
|
1434
1451
|
usageError = message;
|
|
1435
1452
|
}
|
|
1436
|
-
function stateHome(env =
|
|
1453
|
+
function stateHome(env = process15.env) {
|
|
1437
1454
|
const dir = env.XDG_STATE_HOME;
|
|
1438
1455
|
return dir !== undefined && isAbsolute(dir) ? dir : join4(homedir3(), ".local", "state");
|
|
1439
1456
|
}
|
|
1440
|
-
function usagePath(env =
|
|
1457
|
+
function usagePath(env = process15.env) {
|
|
1441
1458
|
return join4(stateHome(env), CLI_FOLDER, "usage.jsonl");
|
|
1442
1459
|
}
|
|
1443
|
-
function usageRecorded(env =
|
|
1460
|
+
function usageRecorded(env = process15.env) {
|
|
1444
1461
|
const off = env.KAYNOOO_CLI_NO_USAGE;
|
|
1445
1462
|
return env.NODE_ENV !== "test" && (off === undefined || off === "" || off === "0");
|
|
1446
1463
|
}
|
|
@@ -1454,7 +1471,7 @@ function usageEntry(bin, command, argv, code, now = new Date) {
|
|
|
1454
1471
|
usageError = undefined;
|
|
1455
1472
|
return { at: now.toISOString(), bin, ...command === undefined ? {} : { command }, flags: flagNames(argv), code, ...unknown === undefined ? {} : { unknown } };
|
|
1456
1473
|
}
|
|
1457
|
-
function recordUsage(entry, env =
|
|
1474
|
+
function recordUsage(entry, env = process15.env) {
|
|
1458
1475
|
if (!usageRecorded(env))
|
|
1459
1476
|
return;
|
|
1460
1477
|
try {
|
|
@@ -1545,8 +1562,8 @@ async function help2({ path, header, summary: lazySummary, commands, defaultComm
|
|
|
1545
1562
|
`);
|
|
1546
1563
|
}
|
|
1547
1564
|
function printError(prefix, message, hint, cause) {
|
|
1548
|
-
const colors = paint(
|
|
1549
|
-
const styled = takesControlCodes(
|
|
1565
|
+
const colors = paint(process16.stderr);
|
|
1566
|
+
const styled = takesControlCodes(process16.stderr);
|
|
1550
1567
|
const head = styled ? `${colors.red.bold("error")} ${colors.dim(`${prefix}:`)}` : `error: ${prefix}:`;
|
|
1551
1568
|
const under = (label, text, tint) => text === undefined ? "" : `
|
|
1552
1569
|
${styled ? tint(label) : `${label}:`} ${text}`;
|
|
@@ -1556,8 +1573,8 @@ function runHint(command, effect) {
|
|
|
1556
1573
|
return `run \`${command}\`${effect === undefined ? "" : ` to ${effect}`}`;
|
|
1557
1574
|
}
|
|
1558
1575
|
function printHint(hint) {
|
|
1559
|
-
const colors = paint(
|
|
1560
|
-
console.error(` ${takesControlCodes(
|
|
1576
|
+
const colors = paint(process16.stderr);
|
|
1577
|
+
console.error(` ${takesControlCodes(process16.stderr) ? colors.yellow("hint") : "hint:"} ${hint}`);
|
|
1561
1578
|
}
|
|
1562
1579
|
function printJsonError(message, hint, cause) {
|
|
1563
1580
|
console.error(JSON.stringify({ error: message, ...hint === undefined ? {} : { hint }, ...cause === undefined ? {} : { cause } }));
|
|
@@ -1596,11 +1613,11 @@ async function dispatch(level, typed, { version, redact }) {
|
|
|
1596
1613
|
}
|
|
1597
1614
|
}
|
|
1598
1615
|
if (name === undefined && level.path.length > 1) {
|
|
1599
|
-
console.error(await help2(await expand(level, [...level.path.slice(1), ...argv]),
|
|
1616
|
+
console.error(await help2(await expand(level, [...level.path.slice(1), ...argv]), process16.stderr));
|
|
1600
1617
|
return 2;
|
|
1601
1618
|
}
|
|
1602
1619
|
if (name === undefined || name === "help" || name === "--help" || name === "-h") {
|
|
1603
|
-
console.log(await help2(await expand(level, [...level.path.slice(1), ...argv]),
|
|
1620
|
+
console.log(await help2(await expand(level, [...level.path.slice(1), ...argv]), process16.stdout));
|
|
1604
1621
|
return 0;
|
|
1605
1622
|
}
|
|
1606
1623
|
if (level.path.length === 1 && (name === "--version" || name === "-v")) {
|
|
@@ -1727,7 +1744,7 @@ function packageVersion(entry = Bun.main) {
|
|
|
1727
1744
|
return "0.0.0";
|
|
1728
1745
|
}
|
|
1729
1746
|
}
|
|
1730
|
-
async function runCli(cli, argv =
|
|
1747
|
+
async function runCli(cli, argv = process16.argv.slice(2)) {
|
|
1731
1748
|
const version = cli.version ?? packageVersion();
|
|
1732
1749
|
if (argv[0] === COMPLETE)
|
|
1733
1750
|
return printCandidates(candidates(scopeOf(cli.commands, cli.extraCommands, cli.aliases), cli.defaultCommand, argv.slice(1)));
|
|
@@ -1758,7 +1775,7 @@ function commandPath(scope, argv) {
|
|
|
1758
1775
|
var SKIPPED_FOLDERS = new Set(["node_modules", "vendor", "dist", "build", "target", "coverage", "venv", "__pycache__"]);
|
|
1759
1776
|
// ../kit/src/git.ts
|
|
1760
1777
|
import { basename, dirname as dirname4 } from "path";
|
|
1761
|
-
import
|
|
1778
|
+
import process17 from "process";
|
|
1762
1779
|
var ORIGIN_PREFIX = /^origin\//;
|
|
1763
1780
|
var GIT_NETWORK_MS = 60000;
|
|
1764
1781
|
async function git(args, timeoutMs) {
|
|
@@ -1788,7 +1805,7 @@ async function defaultBranch() {
|
|
|
1788
1805
|
async function leaveWorktree() {
|
|
1789
1806
|
const common = await git(["rev-parse", "--path-format=absolute", "--git-common-dir"]);
|
|
1790
1807
|
if (basename(common) === ".git")
|
|
1791
|
-
|
|
1808
|
+
process17.chdir(dirname4(common));
|
|
1792
1809
|
}
|
|
1793
1810
|
// ../kit/src/limit.ts
|
|
1794
1811
|
function limitOptions(fallback) {
|
|
@@ -1829,15 +1846,15 @@ var SECRET_WORDS = new Set(["key", "pass", "pwd", "auth", "salt", "cookie", "ses
|
|
|
1829
1846
|
// ../kit/src/sessions.ts
|
|
1830
1847
|
import { homedir as homedir4 } from "os";
|
|
1831
1848
|
import { join as join6 } from "path";
|
|
1832
|
-
import
|
|
1849
|
+
import process18 from "process";
|
|
1833
1850
|
var {Glob } = globalThis.Bun;
|
|
1834
1851
|
var SESSION_FILES = new Glob("*.json");
|
|
1835
1852
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1836
1853
|
async function sessionDirs() {
|
|
1837
1854
|
const home = homedir4();
|
|
1838
1855
|
const dirs = new Set([join6(home, ".claude", "sessions")]);
|
|
1839
|
-
if (
|
|
1840
|
-
dirs.add(join6(
|
|
1856
|
+
if (process18.env.CLAUDE_CONFIG_DIR !== undefined)
|
|
1857
|
+
dirs.add(join6(process18.env.CLAUDE_CONFIG_DIR, "sessions"));
|
|
1841
1858
|
try {
|
|
1842
1859
|
for await (const dir of ACCOUNT_DIRS.scan({ cwd: join6(home, ".claude-accounts"), onlyFiles: false, absolute: true }))
|
|
1843
1860
|
dirs.add(dir);
|
|
@@ -1883,7 +1900,7 @@ async function liveSessions() {
|
|
|
1883
1900
|
}
|
|
1884
1901
|
async function currentSession(sessions) {
|
|
1885
1902
|
const byPid = new Map(sessions.map((session) => [session.pid, session]));
|
|
1886
|
-
let pid =
|
|
1903
|
+
let pid = process18.ppid;
|
|
1887
1904
|
for (let depth = 0;depth < 32 && pid > 1; depth++) {
|
|
1888
1905
|
const session = byPid.get(pid);
|
|
1889
1906
|
if (session !== undefined)
|
|
@@ -1896,7 +1913,7 @@ async function currentSession(sessions) {
|
|
|
1896
1913
|
return;
|
|
1897
1914
|
}
|
|
1898
1915
|
// ../kit/src/watch.ts
|
|
1899
|
-
import
|
|
1916
|
+
import process19 from "process";
|
|
1900
1917
|
import { format } from "util";
|
|
1901
1918
|
var CLEAR_SCREEN = "\x1B[H\x1B[2J";
|
|
1902
1919
|
var DEFAULT_SECONDS = 2;
|
|
@@ -1918,7 +1935,7 @@ function withoutWatch(args) {
|
|
|
1918
1935
|
}
|
|
1919
1936
|
return rest;
|
|
1920
1937
|
}
|
|
1921
|
-
async function watching(value, step, stream =
|
|
1938
|
+
async function watching(value, step, stream = process19.stdout, sleep = Bun.sleep, rounds = Number.POSITIVE_INFINITY) {
|
|
1922
1939
|
const interval = value === "" ? DEFAULT_SECONDS * 1000 : duration(value, "watch", DEFAULT_SECONDS * 1000);
|
|
1923
1940
|
if (!takesControlCodes(stream))
|
|
1924
1941
|
badUsage("--watch redraws the screen, so it needs a terminal");
|
|
@@ -1926,12 +1943,12 @@ async function watching(value, step, stream = process18.stdout, sleep = Bun.slee
|
|
|
1926
1943
|
for (let round = 0;round < rounds; round++) {
|
|
1927
1944
|
const held = [];
|
|
1928
1945
|
const { log, info } = console;
|
|
1929
|
-
const write =
|
|
1946
|
+
const write = process19.stdout.write.bind(process19.stdout);
|
|
1930
1947
|
const hold = (...parts) => void held.push(`${format(...parts)}
|
|
1931
1948
|
`);
|
|
1932
1949
|
console.log = hold;
|
|
1933
1950
|
console.info = hold;
|
|
1934
|
-
|
|
1951
|
+
process19.stdout.write = (text) => {
|
|
1935
1952
|
held.push(typeof text === "string" ? text : Buffer.from(text).toString());
|
|
1936
1953
|
return true;
|
|
1937
1954
|
};
|
|
@@ -1940,7 +1957,7 @@ async function watching(value, step, stream = process18.stdout, sleep = Bun.slee
|
|
|
1940
1957
|
} finally {
|
|
1941
1958
|
console.log = log;
|
|
1942
1959
|
console.info = info;
|
|
1943
|
-
|
|
1960
|
+
process19.stdout.write = write;
|
|
1944
1961
|
}
|
|
1945
1962
|
stream.write(`${CLEAR_SCREEN}${held.join("")}`);
|
|
1946
1963
|
await sleep(interval);
|
|
@@ -2117,10 +2134,16 @@ function holderSession(holder, sessions) {
|
|
|
2117
2134
|
return lane === undefined ? undefined : sessions.find((session) => session.name.endsWith(`-${lane}`));
|
|
2118
2135
|
}
|
|
2119
2136
|
|
|
2137
|
+
// src/good.ts
|
|
2138
|
+
import process21 from "process";
|
|
2139
|
+
function good(text) {
|
|
2140
|
+
return role("ok", process21.stdout)(text);
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2120
2143
|
// src/forge.ts
|
|
2121
2144
|
import { homedir as homedir5 } from "os";
|
|
2122
2145
|
import { join as join7 } from "path";
|
|
2123
|
-
import
|
|
2146
|
+
import process22 from "process";
|
|
2124
2147
|
|
|
2125
2148
|
// src/remote.ts
|
|
2126
2149
|
var SCP_LIKE = /^(?:([^@/]+)@)?([^:/]+):(?!\/)(.+?)(?:\.git)?\/?$/;
|
|
@@ -2175,7 +2198,7 @@ function loginHosts(config) {
|
|
|
2175
2198
|
return hosts;
|
|
2176
2199
|
}
|
|
2177
2200
|
function teaConfigPath() {
|
|
2178
|
-
const base =
|
|
2201
|
+
const base = process22.env.XDG_CONFIG_HOME;
|
|
2179
2202
|
return join7(base !== undefined && base !== "" ? base : join7(homedir5(), ".config"), "tea", "config.yml");
|
|
2180
2203
|
}
|
|
2181
2204
|
async function readConfig() {
|
|
@@ -2642,7 +2665,7 @@ async function take(args) {
|
|
|
2642
2665
|
const standingNow = latestClaim(await commentsOf(number, values.repo), author);
|
|
2643
2666
|
if (standingNow?.holder !== name)
|
|
2644
2667
|
fail(`#${number} was taken by ${standingNow?.holder ?? "another session"} at the same moment`, 1);
|
|
2645
|
-
console.log(`took #${number} as ${name}: ${found.title}`);
|
|
2668
|
+
console.log(good(`took #${number} as ${name}: ${found.title}`));
|
|
2646
2669
|
});
|
|
2647
2670
|
}
|
|
2648
2671
|
var dropUsage = `ft drop <n>... [--stale] | --all-stale [--dry-run]
|
|
@@ -2668,7 +2691,7 @@ async function releaseStale(number, me, author, sessions, repo) {
|
|
|
2668
2691
|
fail(`#${number} is taken by ${claim.holder}, which still runs (${current.session.status})`, 1);
|
|
2669
2692
|
await comment(number, releasedComment(claim.holder), repo);
|
|
2670
2693
|
await comment(number, `Claim of ${claim.holder} from ${formatAge(claim.at)}, which no live session answered to, released as stale by session ${me}.`, repo);
|
|
2671
|
-
console.log(`released #${number}, held by ${claim.holder}`);
|
|
2694
|
+
console.log(good(`released #${number}, held by ${claim.holder}`));
|
|
2672
2695
|
}
|
|
2673
2696
|
async function drop(args) {
|
|
2674
2697
|
const parsed = parse(args, dropUsage, dropOptions);
|
|
@@ -2706,12 +2729,12 @@ async function drop(args) {
|
|
|
2706
2729
|
if (claim?.holder !== name)
|
|
2707
2730
|
fail(`#${number} is ${claim === undefined ? "not taken" : `taken by ${claim.holder}, not ${name}`}`, 1, claim === undefined ? undefined : runHint(`ft drop ${number} --stale`, "release it if no session answers to it"));
|
|
2708
2731
|
await comment(number, releasedComment(name), values.repo);
|
|
2709
|
-
console.log(`released #${number}`);
|
|
2732
|
+
console.log(good(`released #${number}`));
|
|
2710
2733
|
});
|
|
2711
2734
|
}
|
|
2712
2735
|
|
|
2713
2736
|
// src/commands/ci.ts
|
|
2714
|
-
import
|
|
2737
|
+
import process23 from "process";
|
|
2715
2738
|
|
|
2716
2739
|
// src/git.ts
|
|
2717
2740
|
async function tagsAt(commit) {
|
|
@@ -2967,7 +2990,7 @@ async function ci2(args) {
|
|
|
2967
2990
|
return;
|
|
2968
2991
|
}
|
|
2969
2992
|
const json = values.json === true;
|
|
2970
|
-
const { dim } = paint(
|
|
2993
|
+
const { dim } = paint(process23.stderr);
|
|
2971
2994
|
const runs = await waitForCi({
|
|
2972
2995
|
tool: "ft ci",
|
|
2973
2996
|
short,
|
|
@@ -2992,7 +3015,7 @@ async function ci2(args) {
|
|
|
2992
3015
|
},
|
|
2993
3016
|
lines: (spinner, found, started) => [
|
|
2994
3017
|
`${spinner} CI on ${short} ${dim(formatElapsed(Date.now() - started))}`,
|
|
2995
|
-
...(found ?? []).map((run) => ` ${badge(run.status,
|
|
3018
|
+
...(found ?? []).map((run) => ` ${badge(run.status, process23.stderr)} ${run.workflow_id} ${dim(`run ${run.id}`)}`)
|
|
2996
3019
|
]
|
|
2997
3020
|
});
|
|
2998
3021
|
const status = overall(runs);
|
|
@@ -3008,7 +3031,7 @@ async function ci2(args) {
|
|
|
3008
3031
|
return status === "failure" ? 1 : 0;
|
|
3009
3032
|
}
|
|
3010
3033
|
if (status !== "failure") {
|
|
3011
|
-
console.log(`CI ${status === "success" ? "passed" : "skipped its tests, a release tag's workflow testing them"} on ${short}`);
|
|
3034
|
+
console.log(good(`CI ${status === "success" ? "passed" : "skipped its tests, a release tag's workflow testing them"} on ${short}`));
|
|
3012
3035
|
return 0;
|
|
3013
3036
|
}
|
|
3014
3037
|
for (const run of runs) {
|
|
@@ -3022,7 +3045,7 @@ run ${run.id} failed${run.commit_sha === sha ? "" : `, testing every commit from
|
|
|
3022
3045
|
}
|
|
3023
3046
|
|
|
3024
3047
|
// src/commands/digest.ts
|
|
3025
|
-
import
|
|
3048
|
+
import process24 from "process";
|
|
3026
3049
|
var RUNS_SCANNED = 50;
|
|
3027
3050
|
var TITLE_WIDTH2 = 70;
|
|
3028
3051
|
var SHOWN = 8;
|
|
@@ -3072,7 +3095,7 @@ async function quietly(read) {
|
|
|
3072
3095
|
}
|
|
3073
3096
|
}
|
|
3074
3097
|
async function staleTodos() {
|
|
3075
|
-
const bin = Bun.which("todo-scan", { PATH:
|
|
3098
|
+
const bin = Bun.which("todo-scan", { PATH: process24.env.PATH ?? "" });
|
|
3076
3099
|
if (bin === null)
|
|
3077
3100
|
return [];
|
|
3078
3101
|
let found;
|
|
@@ -3094,8 +3117,8 @@ async function staleTodos() {
|
|
|
3094
3117
|
return [...byIssue.values()];
|
|
3095
3118
|
}
|
|
3096
3119
|
function claimLine(row, now) {
|
|
3097
|
-
const id = role("id",
|
|
3098
|
-
return [id(`#${row.number}`), row.holder, paint(
|
|
3120
|
+
const id = role("id", process24.stdout);
|
|
3121
|
+
return [id(`#${row.number}`), row.holder, paint(process24.stdout).dim(formatAge(row.since, now)), row.boxesTotal === 0 ? "" : `${row.boxesLeft}/${row.boxesTotal} left`, truncate(row.title, TITLE_WIDTH2)];
|
|
3099
3122
|
}
|
|
3100
3123
|
function capped2(lines) {
|
|
3101
3124
|
return lines.length > SHOWN ? [...lines.slice(0, SHOWN), `... ${lines.length - SHOWN} more`] : lines;
|
|
@@ -3106,13 +3129,13 @@ function renderDigest(digest, now = Date.now()) {
|
|
|
3106
3129
|
`) },
|
|
3107
3130
|
{ heading: "claimed, no live session here", tone: "warn", count: digest.away.length, lines: table(digest.away.map((row) => claimLine(row, now))).split(`
|
|
3108
3131
|
`) },
|
|
3109
|
-
{ heading: "CI on the default branch", tone: "failed", count: digest.ci.length, lines: digest.ci.map((run) => `${run.workflow} ${badge(run.status,
|
|
3132
|
+
{ heading: "CI on the default branch", tone: "failed", count: digest.ci.length, lines: digest.ci.map((run) => `${run.workflow} ${badge(run.status, process24.stdout)} (run ${run.id}) ${truncate(upTo(run.title, `
|
|
3110
3133
|
`), TITLE_WIDTH2)}`) },
|
|
3111
3134
|
{ heading: "unpushed commits", tone: "queued", count: digest.unpushed.length, lines: capped2(digest.unpushed) },
|
|
3112
|
-
{ heading: "dirty files", tone: "warn", count: digest.dirty.length, lines: capped2(digest.dirty.map((file) => `${file.status} ${role("path",
|
|
3135
|
+
{ heading: "dirty files", tone: "warn", count: digest.dirty.length, lines: capped2(digest.dirty.map((file) => `${file.status} ${role("path", process24.stdout)(file.path)}`)) },
|
|
3113
3136
|
{ heading: "stale TODO comments", tone: "skipped", count: digest.stale.length, lines: capped2(digest.stale.map((todo) => `${todo.issue} closed: ${todo.comments.map((each) => `${each.path}:${each.line}`).join(", ")}`)) }
|
|
3114
3137
|
].filter((each) => each.count > 0);
|
|
3115
|
-
return sections.length === 0 ? "nothing to pick up" : sections.map(({ heading, tone, count, lines }) => `${section(heading, count,
|
|
3138
|
+
return sections.length === 0 ? "nothing to pick up" : sections.map(({ heading, tone, count, lines }) => `${section(heading, count, process24.stdout, process24.env, tone)}
|
|
3116
3139
|
${lines.join(`
|
|
3117
3140
|
`).replace(LINE_START2, " ")}`).join(`
|
|
3118
3141
|
|
|
@@ -3240,12 +3263,12 @@ ${tickUsage}`);
|
|
|
3240
3263
|
}, values.repo);
|
|
3241
3264
|
}
|
|
3242
3265
|
for (const box of result.changed)
|
|
3243
|
-
console.log(`${done ? "ticked" : "unticked"} ${box.number}: ${box.text}`);
|
|
3266
|
+
console.log(good(`${done ? "ticked" : "unticked"} ${box.number}: ${box.text}`));
|
|
3244
3267
|
const left = boxes(result.body).filter((box) => !box.done).length;
|
|
3245
3268
|
console.log(`#${number}: ${result.changed.length === 0 ? "nothing to change, " : ""}${left} box${left === 1 ? "" : "es"} left`);
|
|
3246
3269
|
if (note !== undefined) {
|
|
3247
3270
|
await comment(number, note, values.repo);
|
|
3248
|
-
console.log(`commented on #${number}`);
|
|
3271
|
+
console.log(good(`commented on #${number}`));
|
|
3249
3272
|
}
|
|
3250
3273
|
return 0;
|
|
3251
3274
|
}
|
|
@@ -3292,7 +3315,7 @@ async function tickListings(closed, repo) {
|
|
|
3292
3315
|
if (!referencedBoxes(listing.body).some(({ box, issue }) => issue === closed && !box.done))
|
|
3293
3316
|
continue;
|
|
3294
3317
|
if (await editBody(listing.number, (body) => tickReferences(body, (issue) => issue === closed).body, repo))
|
|
3295
|
-
console.log(`ticked #${closed} in #${listing.number}`);
|
|
3318
|
+
console.log(good(`ticked #${closed} in #${listing.number}`));
|
|
3296
3319
|
}
|
|
3297
3320
|
}
|
|
3298
3321
|
async function fixed(args) {
|
|
@@ -3306,7 +3329,7 @@ async function fixed(args) {
|
|
|
3306
3329
|
const left = boxes(found.body).filter((box) => !box.done);
|
|
3307
3330
|
if (left.length > 0 && values.tick === true) {
|
|
3308
3331
|
await editBody(number, (body) => setBoxes(body, boxes(body).filter((box) => !box.done).map((box) => String(box.number)), true).body, values.repo);
|
|
3309
|
-
console.log(`ticked ${left.length} box${left.length === 1 ? "" : "es"} of #${number}`);
|
|
3332
|
+
console.log(good(`ticked ${left.length} box${left.length === 1 ? "" : "es"} of #${number}`));
|
|
3310
3333
|
} else if (left.length > 0 && values.force !== true) {
|
|
3311
3334
|
fail(`#${number} has ${left.length} boxes left:
|
|
3312
3335
|
${left.map((box) => `${String(box.number).padStart(3)} [ ] ${box.text}`).join(`
|
|
@@ -3317,7 +3340,7 @@ ${left.map((box) => `${String(box.number).padStart(3)} [ ] ${box.text}`).join(`
|
|
|
3317
3340
|
if ((await commentsOf(number, values.repo)).at(-1)?.body.trim() !== line.trim())
|
|
3318
3341
|
await comment(number, line, values.repo);
|
|
3319
3342
|
await close(number, values.repo);
|
|
3320
|
-
console.log(`closed #${number}: fixed in ${shas}`);
|
|
3343
|
+
console.log(good(`closed #${number}: fixed in ${shas}`));
|
|
3321
3344
|
await tickListings(number, values.repo);
|
|
3322
3345
|
return 0;
|
|
3323
3346
|
}
|
|
@@ -3348,7 +3371,7 @@ async function setState(args, usage, wanted) {
|
|
|
3348
3371
|
await close(number, values.repo);
|
|
3349
3372
|
else
|
|
3350
3373
|
await reopen(number, values.repo);
|
|
3351
|
-
console.log(`${wanted === "closed" ? "closed" : "reopened"} #${number}`);
|
|
3374
|
+
console.log(good(`${wanted === "closed" ? "closed" : "reopened"} #${number}`));
|
|
3352
3375
|
}
|
|
3353
3376
|
return 0;
|
|
3354
3377
|
}
|
|
@@ -3494,7 +3517,7 @@ ${text}` : body;
|
|
|
3494
3517
|
return missing.length > 0 ? appendBoxes(appended, missing) : appended;
|
|
3495
3518
|
}, values.repo);
|
|
3496
3519
|
}
|
|
3497
|
-
console.log(`edited #${number}`);
|
|
3520
|
+
console.log(good(`edited #${number}`));
|
|
3498
3521
|
return 0;
|
|
3499
3522
|
}
|
|
3500
3523
|
var commentUsage = `ft comment [<n>] [text]
|
|
@@ -3518,7 +3541,7 @@ async function commentOn(args) {
|
|
|
3518
3541
|
|
|
3519
3542
|
${commentUsage}`);
|
|
3520
3543
|
await comment(number, text, values.repo);
|
|
3521
|
-
console.log(`commented on #${number}`);
|
|
3544
|
+
console.log(good(`commented on #${number}`));
|
|
3522
3545
|
return 0;
|
|
3523
3546
|
}
|
|
3524
3547
|
|
|
@@ -3665,28 +3688,59 @@ async function logs2(args) {
|
|
|
3665
3688
|
printJson({ ...ciJson([run], shown.filter((job) => job.status === "failure").map((job) => ({ name: job.name, run: run.id, workflow: run.workflow_id, excerpt: job.excerpt }))), jobs: shown });
|
|
3666
3689
|
return 0;
|
|
3667
3690
|
}
|
|
3668
|
-
console.log(`${run.workflow_id} run ${run.id} on ${run.prettyref} (${run.commit_sha.slice(0, 7)}): ${badge(run.status, process.stdout)}, ${run.html_url}`);
|
|
3691
|
+
console.log(`${paint(process.stdout).bold(`${run.workflow_id} run ${run.id}`)} on ${run.prettyref} (${run.commit_sha.slice(0, 7)}): ${badge(run.status, process.stdout)}, ${role("path", process.stdout)(run.html_url)}`);
|
|
3669
3692
|
for (const job of picked) {
|
|
3670
3693
|
console.log(`
|
|
3671
|
-
job ${job.name}: ${badge(job.status, process.stdout)}
|
|
3694
|
+
${paint(process.stdout).bold(`job ${job.name}`)}: ${badge(job.status, process.stdout)}
|
|
3672
3695
|
${await text(job)}`);
|
|
3673
3696
|
}
|
|
3674
3697
|
return 0;
|
|
3675
3698
|
}
|
|
3676
3699
|
|
|
3677
3700
|
// src/commands/milestone.ts
|
|
3701
|
+
import process25 from "process";
|
|
3678
3702
|
var TITLE_WIDTH3 = 60;
|
|
3679
3703
|
var LIST_LIMIT = 30;
|
|
3704
|
+
var CONCURRENCY2 = 4;
|
|
3680
3705
|
function counts(milestone) {
|
|
3681
3706
|
return `${milestone.open_issues} open, ${milestone.closed_issues} closed`;
|
|
3682
3707
|
}
|
|
3708
|
+
function progressBar(milestone) {
|
|
3709
|
+
const total = milestone.open_issues + milestone.closed_issues;
|
|
3710
|
+
return takesControlCodes(process25.stdout) ? bar(total === 0 ? 0 : milestone.closed_issues / total, { width: 16 }) : "";
|
|
3711
|
+
}
|
|
3712
|
+
function milestoneCells(each, showState) {
|
|
3713
|
+
const drawn = progressBar(each);
|
|
3714
|
+
return [String(each.id), truncate(each.title, TITLE_WIDTH3), `${each.open_issues} open`, `${each.closed_issues} closed`, ...drawn === "" ? [] : [drawn], progress(each), dueDate(each) === "" ? "" : `due ${dueDate(each)}`, ...showState ? [each.state] : []];
|
|
3715
|
+
}
|
|
3716
|
+
async function printWithIssues(list, repo) {
|
|
3717
|
+
const colors = paint(process25.stdout);
|
|
3718
|
+
const id = role("id", process25.stdout);
|
|
3719
|
+
const issuesOf = await pool(list, CONCURRENCY2, async (each) => Promise.all([openIssues(undefined, repo, each.id), closedIssues(each.id, repo)]));
|
|
3720
|
+
const blocks = list.map((each, index) => {
|
|
3721
|
+
const byNumber = (left, right) => left.number - right.number;
|
|
3722
|
+
const [open, closed] = issuesOf[index].map((found) => found.toSorted(byNumber));
|
|
3723
|
+
const drawn = progressBar(each);
|
|
3724
|
+
const facts = [counts(each), progress(each), dueDate(each) === "" ? "" : `due ${dueDate(each)}`].filter((fact) => fact !== "").join(", ");
|
|
3725
|
+
const lines = [
|
|
3726
|
+
...open.map((issue) => ` ${id(`#${issue.number}`)} ${truncate(issue.title, TITLE_WIDTH3)}`),
|
|
3727
|
+
...closed.map((issue) => colors.dim(` #${issue.number} ${truncate(issue.title, TITLE_WIDTH3)} (closed)`))
|
|
3728
|
+
];
|
|
3729
|
+
return [section(`${each.title}${drawn === "" ? "" : ` ${drawn}`} ${facts}`, undefined, process25.stdout, process25.env, "accent"), ...lines].join(`
|
|
3730
|
+
`);
|
|
3731
|
+
});
|
|
3732
|
+
console.log(blocks.join(`
|
|
3733
|
+
|
|
3734
|
+
`));
|
|
3735
|
+
}
|
|
3683
3736
|
var listUsage = `ft milestones
|
|
3684
3737
|
|
|
3685
|
-
Lists the repository's milestones, the open ones unless --state says otherwise, with the issues open and closed in each, the progress and the due date.
|
|
3738
|
+
Lists the repository's milestones, the open ones unless --state says otherwise, with the issues open and closed in each, the progress and the due date; on a terminal the progress is a bar, and --issues lists the title of every issue under its milestone.
|
|
3686
3739
|
|
|
3687
3740
|
Exits 0 when it listed them, 1 when Forgejo refuses, 2 on a usage error.`;
|
|
3688
3741
|
var listOptions = {
|
|
3689
3742
|
state: { type: "string", description: "open (the default), closed or all" },
|
|
3743
|
+
issues: { type: "boolean", short: "i", description: "list the open and closed issues of each milestone by title" },
|
|
3690
3744
|
...limitOptions(LIST_LIMIT),
|
|
3691
3745
|
json: jsonOption("id, title, state, description, open, closed, due (YYYY-MM-DD or null)"),
|
|
3692
3746
|
...repoOption
|
|
@@ -3699,6 +3753,8 @@ async function milestones(args) {
|
|
|
3699
3753
|
fail(`--state takes open, closed or all, not ${state}`);
|
|
3700
3754
|
const limit = limitOf(values, LIST_LIMIT);
|
|
3701
3755
|
const found = await listMilestones(state, values.repo);
|
|
3756
|
+
if (values.issues === true && values.json === true)
|
|
3757
|
+
fail("--issues lists for a person, --json has the counts only");
|
|
3702
3758
|
if (values.json === true) {
|
|
3703
3759
|
printJson(found.slice(0, limit).map((each) => ({ id: each.id, title: each.title, state: each.state, description: each.description, open: each.open_issues, closed: each.closed_issues, due: dueDate(each) || null })));
|
|
3704
3760
|
return 0;
|
|
@@ -3708,9 +3764,10 @@ async function milestones(args) {
|
|
|
3708
3764
|
return 0;
|
|
3709
3765
|
}
|
|
3710
3766
|
const { shown, footer } = capped(found, limit);
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3767
|
+
if (values.issues === true)
|
|
3768
|
+
await printWithIssues(shown, values.repo);
|
|
3769
|
+
else
|
|
3770
|
+
console.log(table(shown.map((each) => milestoneCells(each, state === "all"))));
|
|
3714
3771
|
if (footer !== undefined)
|
|
3715
3772
|
console.log(footer);
|
|
3716
3773
|
return 0;
|
|
@@ -3766,7 +3823,7 @@ ${closeUsage2}`);
|
|
|
3766
3823
|
${open.map((issue) => ` #${issue.number} ${truncate(issue.title, TITLE_WIDTH3)}`).join(`
|
|
3767
3824
|
`)}`, 1, `${runHint(`ft milestone close ${found.title} --force`, "close it with them open")}, or move them with \`ft edit <n> -m <milestone>\``);
|
|
3768
3825
|
await closeMilestone(found.id, values.repo);
|
|
3769
|
-
console.log(`closed milestone ${found.title}`);
|
|
3826
|
+
console.log(good(`closed milestone ${found.title}`));
|
|
3770
3827
|
return 0;
|
|
3771
3828
|
}
|
|
3772
3829
|
var showUsage = `ft milestone <title|id>
|
|
@@ -3930,12 +3987,12 @@ async function carry(args) {
|
|
|
3930
3987
|
function report(plan, added, skipped) {
|
|
3931
3988
|
for (const line of added)
|
|
3932
3989
|
console.log(`#${plan}: ${line}`);
|
|
3933
|
-
console.log(`#${plan}: ${added.length} added${skipped === 0 ? "" : `, ${skipped} already listed`}`);
|
|
3990
|
+
console.log(good(`#${plan}: ${added.length} added${skipped === 0 ? "" : `, ${skipped} already listed`}`));
|
|
3934
3991
|
}
|
|
3935
3992
|
|
|
3936
3993
|
// src/commands/release.ts
|
|
3937
3994
|
import { basename as basename3, join as join11 } from "path";
|
|
3938
|
-
import
|
|
3995
|
+
import process27 from "process";
|
|
3939
3996
|
var {$: $2 } = globalThis.Bun;
|
|
3940
3997
|
|
|
3941
3998
|
// src/commands/watch.ts
|
|
@@ -4179,12 +4236,12 @@ async function publishable() {
|
|
|
4179
4236
|
|
|
4180
4237
|
// src/commands/release-plan.ts
|
|
4181
4238
|
import { basename as basename2, join as join9, relative } from "path";
|
|
4182
|
-
import
|
|
4239
|
+
import process26 from "process";
|
|
4183
4240
|
async function planOf({ level, dir, prefix }, registry) {
|
|
4184
4241
|
const file = Bun.file(join9(dir ?? ".", "package.json"));
|
|
4185
4242
|
const pkg = await file.exists() ? await file.json() : undefined;
|
|
4186
|
-
const name = pkg?.name ?? basename2(dir ??
|
|
4187
|
-
const where = dir === undefined ? "" : ` in ${relative(
|
|
4243
|
+
const name = pkg?.name ?? basename2(dir ?? process26.cwd());
|
|
4244
|
+
const where = dir === undefined ? "" : ` in ${relative(process26.cwd(), dir) || "."}`;
|
|
4188
4245
|
let version;
|
|
4189
4246
|
let bump;
|
|
4190
4247
|
if (level === undefined) {
|
|
@@ -4429,7 +4486,7 @@ ${push.stderr.trim()}`, signal === undefined ? 1 : exitCodeOf(null, signal));
|
|
|
4429
4486
|
if (late !== undefined)
|
|
4430
4487
|
fail(`interrupted by ${late} after ${bumped.map((each) => each.tag).join(", ")} ${bumped.length === 1 ? "was pushed: its runs are" : "were pushed: their runs are"} not waited for`, exitCodeOf(null, late));
|
|
4431
4488
|
say(`pushed ${branch} and ${bumped.map((each) => each.tag).join(", ")}, waiting for their runs`);
|
|
4432
|
-
followed = await followRuns((runs) => runs.filter((run) => run.id > before && heads.has(run.commit_sha)), timeout, undefined, NO_RUN2, json ?
|
|
4489
|
+
followed = await followRuns((runs) => runs.filter((run) => run.id > before && heads.has(run.commit_sha)), timeout, undefined, NO_RUN2, json ? process27.stderr : process27.stdout, { json });
|
|
4433
4490
|
if (followed.code !== 0) {
|
|
4434
4491
|
report();
|
|
4435
4492
|
return followed.code;
|
|
@@ -4579,7 +4636,7 @@ async function remote(args, home) {
|
|
|
4579
4636
|
await restoreOrigin(fetchUrl, pushUrls, changes);
|
|
4580
4637
|
return fail(`the switched origin does not answer, so the old URLs were put back: ${redactUrl(error instanceof Error ? error.message : String(error))}`, 1);
|
|
4581
4638
|
}
|
|
4582
|
-
console.log("origin switched, and git ls-remote reaches it");
|
|
4639
|
+
console.log(good("origin switched, and git ls-remote reaches it"));
|
|
4583
4640
|
return 0;
|
|
4584
4641
|
}
|
|
4585
4642
|
|
|
@@ -4634,7 +4691,7 @@ async function runs(args) {
|
|
|
4634
4691
|
}
|
|
4635
4692
|
|
|
4636
4693
|
// src/cli.ts
|
|
4637
|
-
|
|
4694
|
+
process28.exitCode = await runCli({
|
|
4638
4695
|
name: "ft",
|
|
4639
4696
|
about: "Forgejo tools over tea, run from a repository whose origin is on Forgejo",
|
|
4640
4697
|
replaces: "tea api calls piped through jq, and sleep loops waiting on CI",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-forgejo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.25.0",
|
|
5
5
|
"description": "ft: Forgejo CI runs, logs, releases and issue checklists from the terminal, through tea.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|