Details
-
Bug
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Fixed
-
Windows 2008 Server R2, Enterprise Edition, x64
Description
For a build step of type "Execute Windows batch command" Hudson generates and then executes a .bat file using the content provided by the user in the configuration textbox of the step.
The problem is that the generated .bat file has UNIX style EOL (lines ending with LF) and the Windows Command Interpreter (CMD.EXE) requires Windows style EOLs (lines ending with CR LF) in batches, in order to interpret them correctly.
The consequences of having UNIX style EOL in Windows batches is undetermined. Very simple batches work while more complex ones will behave erratically because CMD.EXE will consume multiple lines in one command and it will fail to find some labels.
Attachments
Issue Links
- is duplicated by
-
JENKINS-9528 Glitches due to "Execute Windows batch command" being stored with UNIX line endings
-
- Resolved
-
Code changed in jenkins
User: David Ruhmann
Path:
core/src/main/java/hudson/tasks/BatchFile.java
core/src/main/java/hudson/tasks/Shell.java
core/src/main/java/hudson/tools/AbstractCommandInstaller.java
core/src/main/java/hudson/tools/BatchCommandInstaller.java
core/src/main/java/hudson/tools/CommandInstaller.java
core/src/main/java/hudson/util/LineEndingConversion.java
test/src/test/java/hudson/tasks/BatchFileTest.java
test/src/test/java/hudson/tasks/ShellTest.java
test/src/test/java/hudson/tools/BatchCommandInstallerTest.java
test/src/test/java/hudson/tools/CommandInstallerTest.java
test/src/test/java/hudson/util/LineEndingConversionTest.java
http://jenkins-ci.org/commit/jenkins/67ac47af0709dde6297dffeb210b03d8b65f6033
Log:
[FIXED JENKINS-7478]
Create Line Ending Conversion utility to convert scripts to proper OS
line ending type. Tests included.