We can't use System.lineSeparator() reliably as it returns the master node's line separator. Adding a lineSeparator() step is useful for writing files on various agents.

          [JENKINS-55089] Add a lineSeparator step

          Oleg Nenashev added a comment -

          towel it may be safe to add it, but it will unlikely get you the result you expect in Jenkins Pipeline. In Pipeline scripts will always return the master's system separator. Maybe it's better to propose a new step in Pipeline Utility steps

           

          Oleg Nenashev added a comment - towel it may be safe to add it, but it will unlikely get you the result you expect in Jenkins Pipeline. In Pipeline scripts will always return the master's system separator. Maybe it's better to propose a new step in Pipeline Utility steps  

          Yoav Miles added a comment -

          oleg_nenashev thanks for the prompt response. I'll change this report to ask for a new step, as my case can't be generalized (Jenkins only manages Windows machines at my site).

          Yoav Miles added a comment - oleg_nenashev thanks for the prompt response. I'll change this report to ask for a new step, as my case can't be generalized (Jenkins only manages Windows machines at my site).

          Yoav Miles added a comment -

          On second thought, I think it's better for readFile and writeFile to know how to convert line endings than having to do it manually with another step, but then the change would be less trivial...

          Yoav Miles added a comment - On second thought, I think it's better for readFile and writeFile to know how to convert line endings than having to do it manually with another step, but then the change would be less trivial...

          Larry added a comment - - edited

          Hey everyone,

          I just wanted to chime in on this issue because it really hits close to home for me. Emotions can run high when dealing with problems like these, and I totally understand the frustration some of you are expressing. I've been through a similar situation before, and it can be incredibly overwhelming.

          In my experience, what really helped was implementing a clear line Separator step. It might sound simple, but breaking down the problem into smaller, manageable chunks can make a world of difference. This not only makes the process less daunting but also allows you to track your progress and identify any specific areas that need more attention.

          To the author, I'd strongly recommend considering this approach. It's like giving yourself a roadmap to success, and it can help keep your focus sharp and your motivation up. 

          Recently, I was dealing with a project called "Energy Sector Revolution: Andersen's Innovation Solution for Maschinenfabrik Reinhausen GmbH". I have to admit that it was very hard for me...I had difficulties with line breaks and because of that all the code went wrong. I had to pass this problem to the team lead and he was already looking for a solution...Can you tell me how to avoid this problem? I don't want to have similar difficulties in the future.

          Remember, you're not alone in this – we're all here to support each other.

          Larry added a comment - - edited Hey everyone, I just wanted to chime in on this issue because it really hits close to home for me. Emotions can run high when dealing with problems like these, and I totally understand the frustration some of you are expressing. I've been through a similar situation before, and it can be incredibly overwhelming. In my experience, what really helped was implementing a clear line Separator step. It might sound simple, but breaking down the problem into smaller, manageable chunks can make a world of difference. This not only makes the process less daunting but also allows you to track your progress and identify any specific areas that need more attention. To the author, I'd strongly recommend considering this approach. It's like giving yourself a roadmap to success, and it can help keep your focus sharp and your motivation up.  Recently, I was dealing with a project called " Energy Sector Revolution: Andersen's Innovation Solution for Maschinenfabrik Reinhausen GmbH ". I have to admit that it was very hard for me...I had difficulties with line breaks and because of that all the code went wrong. I had to pass this problem to the team lead and he was already looking for a solution...Can you tell me how to avoid this problem? I don't want to have similar difficulties in the future. Remember, you're not alone in this – we're all here to support each other.

            rsandell rsandell
            towel Yoav Miles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: