{"draft":null,"from":10,"to":11,"files":[{"path":"client/src/commands.ts","added":27,"removed":9,"diff":"--- a/client/src/commands.ts\n+++ b/client/src/commands.ts\n@@ -120,6 +120,21 @@\n \t];\n }\n \n+/**\n+ * A command that left files out for size did not do everything it was asked: say so in the exit code too, so\n+ * a script, CI or an agent cannot read \"ok\" while a file is missing. Other exits (refused, queued) stay as they are.\n+ */\n+export function withLeftOut(out: Output, leftOut: readonly LeftOut[]): Output {\n+\tif (leftOut.length === 0) return out;\n+\tconst text = out.text.includes(\"Left out,\") ? out.text : [out.text, ...leftOutText(leftOut)].join(\"\\n\");\n+\treturn {\n+\t\t...out,\n+\t\ttext: `${text}\\nExit ${EXIT.error}: ${leftOut.length} file${leftOut.length === 1 ? \" was\" : \"s were\"} not sent.`,\n+\t\tjson: { ...out.json, leftOut },\n+\t\texit: out.exit === undefined || out.exit === EXIT.ok ? EXIT.error : out.exit,\n+\t};\n+}\n+\n /** Upload binary files' bytes before the record or init that names them, each hash once. */\n export async function uploadBlobs(api: Api, blobs: ReadonlyMap<string, BlobToSend>): Promise<void> {\n \tconst seen = new Set<string>();\n@@ -290,16 +305,19 @@\n \t\tr.sent === 0\n \t\t\t? \"Nothing to record: the folder matches what the server has.\"\n \t\t\t: `Recorded ${recordedList(r)}${changed === undefined ? \"\" : `; ${changed} changed on the server`}.`;\n-\treturn {\n-\t\ttext: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join(\"\\n\"),\n-\t\tjson: {\n-\t\t\tsent: r.sent,\n-\t\t\tchanged: r.changed ?? null,\n-\t\t\tnews: newsLines(r.news),\n-\t\t\tleftOut: r.leftOut,\n-\t\t\tturnedBinary: r.turnedBinary,\n+\treturn withLeftOut(\n+\t\t{\n+\t\t\ttext: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join(\"\\n\"),\n+\t\t\tjson: {\n+\t\t\t\tsent: r.sent,\n+\t\t\t\tchanged: r.changed ?? null,\n+\t\t\t\tnews: newsLines(r.news),\n+\t\t\t\tleftOut: r.leftOut,\n+\t\t\t\tturnedBinary: r.turnedBinary,\n+\t\t\t},\n \t\t},\n-\t};\n+\t\tr.leftOut,\n+\t);\n }\n \n // --- writing answers into the folder ---"}],"unmatched":[]}