What does the script step "|2-" mean?

workflow-editor
#1

Lately the Bitrise WF gui editor reformats some of my script step with the “|2-” ‘formatting instruction’. It doesnt seem to affect the execution but I am wondering what it is meant to do. I am familiary with “|-” which I take to mean that the script contents are preformatted and not converted to a continuous string (i.e. Stop script step from reformatting the script contents)

- script@1:
    inputs:
    - content: |2-

        #!/usr/bin/env bash
        set -e +x

Does anybody have a link to what that string after the content line means? Should I start adopting that for all of my script step so they wont get reformatted ni the YML editor?

0 Likes

#2

Hi @anuerind
Thank you for reaching out to Bitrise Support.
How long you are seeing that in your WF?
The lines after the content means -

It is an instance of a shebang line : the very first line in an executable plain-text file on Unix-like platforms that tells the system what interpreter to pass that file to for execution , via the command line following the magic #! prefix (called shebang ).

Yes, you should start adopting all of your scripts.

Thanks
Chaitanya

0 Likes

#3

@chaitanya.tanna : i only noticed it last month. I am already familiar with the she-bang notation.

If I understood it correctly, the number is the actual line that is sent as the first line of the script? That implies that if my team is to ensure our workflows do not have unnecessary changes when versioning them we need to ensure that there is no empty space between the ‘content’ directive and the first line of our bash scripts.

Thanks.

0 Likes

#4

Yes, that is correct @anuerind

Thanks
Chaitanya

1 Like

closed #5

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes