Skip to content

Commit b8d112c

Browse files
Den-dpFrozenPandaz
authored andcommitted
fix(core): properly indent command output with mixed line endings (#23321)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior The command output is not indented when it has mixed line endings (`crlf` and `lf`) ![image](https://github.com/nrwl/nx/assets/1770529/5f65e9c4-ded2-4fba-a6c8-9f22297b2b35) ## Expected Behavior ![image](https://github.com/nrwl/nx/assets/1770529/c8111456-407e-47af-8129-4efa6f5792ca) ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> (cherry picked from commit b5d4775)
1 parent ac1061e commit b8d112c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/nx/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function writeCompletedTaskResultLine(line: string) {
490490
function writeCommandOutputBlock(commandOutput: string) {
491491
commandOutput = commandOutput || '';
492492
commandOutput = commandOutput.trimStart();
493-
const lines = commandOutput.split(EOL);
493+
const lines = commandOutput.split(/\r?\n/);
494494
let totalTrailingEmptyLines = 0;
495495
for (let i = lines.length - 1; i >= 0; i--) {
496496
if (lines[i] !== '') {

0 commit comments

Comments
 (0)