Stop script step from reformatting the script contents

script
#1

I frequently edit the workflow using the yaml file interface since it allows for faster navigation. However most of the scripts end up being reformatted from

- script@1:
    title: Decrypt and Install the iOS provisioning profiles and certificates
    inputs:
    - content: |
                #!/usr/bin/env bash
                set +x
                
                #more statements follow

To this:

- script@1:
    title: Decrypt and Install the iOS provisioning profiles and certificates
    inputs:
    - content: "#!/usr/bin/env bash\nset +x\n\n#more statements follow..."

How can I prevent this wrapping/reformatting from happening? Thanks.

1 Like

#2

This seems to be happening when the lines in the script extends past a number of columns (80?). If this is the case then this should at least be made configurable. The 80 character limit is an artifact of an by-gone computing age. It would be a very small population that uses monochrome CRT and dot-matrix printers today.

0 Likes

#3

This snippet also got reformatted and nothing in it reaches the 80th column. :confused:

- script@1:
    title: Check files
    inputs:
    - content: |
        #!/usr/bin/env bash
        set -e
        cd \"$FASTLANE_WORK_DIR\"
        echo list of files are:
        ls -l *txt

        for i in *txt
        do
          echo "Contents of $i:: "
          cat $i
          echo -e "\n"
        done
0 Likes

#4

I have the same problem too. The script is unreadable after reformatting.

0 Likes

#5

Hi @micbakos @anuerind,

I have shared this feedback internally.

1 Like

#6

Thank you for reporting this!

0 Likes

#7

Thank you. I understand the need to ensure the format remains readable in the workflow UI editor but imho it shouldnt be at the expense of the users who prefer editing the raw yml format.

0 Likes

#8

It looks like the same issue as: https://github.com/bitrise-io/bitrise-workflow-editor/issues/168
In a nutshell:

  • in 2017 it happened only when input has trailing whitespaces
  • in 2018 it turns out to happen more often
0 Likes

closed #9

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

0 Likes