fix(core): normalize CRLF line endings in step scripts (#1)

Bash treats a trailing carriage return as part of the command, so notebooks saved with CRLF endings produced broken scripts.
This commit is contained in:
Florian Schmidt
2026-11-16 00:06:28 +01:00
parent eee6c0d4fb
commit c993089f37
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -177,7 +177,8 @@ export function parseNotebook(source: string): Notebook {
artifacts: kind === "run" ? artifacts : [],
uploads: kind === "run" ? uploads : [], timeoutSec,
},
script: rawLines.slice(begin + 1, end).join("\n")
// LF-normalized: bash must never see a trailing \r from CRLF notebooks.
script: lines.slice(begin + 1, end).join("\n")
+ (end > begin + 1 && (end < lines.length || /\n$/.test(source)) ? "\n" : ""),
range: { startLine: begin + 1, endLine: end < lines.length ? end + 1 : end },
};