-
Improvement
-
Resolution: Won't Do
-
Trivial
When using a mutli-line quote, the interpreter must be on the first line, which doesn't look as nice.
Works:
sh """#!/bin/bash -xel set -o pipefail # Do stuff. """
Want:
sh """ #!/bin/bash -xel set -o pipefail # Do stuff. """
(The latter will be passed to the default shell and ignored as a comment since it is on the second line.)
[JENKINS-47787] Multiline shell script should take interpreter from first non-blank line
Component/s | New: workflow-durable-task-step-plugin [ 21715 ] | |
Component/s | Original: pipeline [ 21692 ] |
Labels | Original: pipeline shell-command | New: shell-command |
Resolution | New: Won't Do [ 10001 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
A workaround of putting .trim() at the end of the triple-double quote does work:
sh """ #!/bin/bash -xel set -o pipefail # do stuff """.trim()