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:
@@ -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 },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user