Skip to content

Commit b1dcad4

Browse files
committed
[release] bump @decocms/sandbox to 0.4.2 and normalize carriage returns in cloning logs
1 parent af88fbf commit b1dcad4

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

packages/sandbox/daemon/setup/clone.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,21 @@ function isNonEmptyWithoutGit(dir: string): boolean {
2424
}
2525
}
2626

27+
// Git progress lines use bare \r (no \n) to overwrite the same terminal line.
28+
// Log aggregators strip \r, collapsing all updates into one unreadable blob.
29+
// Normalise \r → \r\n so each update becomes its own log line while still
30+
// giving the user live progress feedback.
31+
function normalizeCarriageReturns(data: string): string {
32+
return data.replace(/\r(?!\n)/g, "\r\n");
33+
}
34+
2735
function runStep(cmd: string, deps: CloneDeps): Promise<number> {
2836
deps.onChunk("setup", `$ ${cmd}\r\n`);
29-
return spawnSetupStep(cmd, deps.onChunk, deps.dropPrivileges);
37+
const normalized: CloneDeps = {
38+
...deps,
39+
onChunk: (src, data) => deps.onChunk(src, normalizeCarriageReturns(data)),
40+
};
41+
return spawnSetupStep(cmd, normalized.onChunk, deps.dropPrivileges);
3042
}
3143

3244
const TRANSIENT_ERRORS = [

packages/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@decocms/sandbox",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"type": "module",
55
"description": "Sandbox runner for isolated per-user containerised tool execution",
66
"scripts": {

0 commit comments

Comments
 (0)