Hello there ,
Here is another tip from our cookbook that I thought might be useful to know. You can divide a command into several lines by writing the line in the folded style
> and by stripping the line break in the yaml file
-. To do this, we can start the command with a line containing only
>- and write the command in more lines below it:
commands: - >- if [ "foo" = "foo" ]; then commands...; else commands...; fi;
Block Style Indicator: The block style indicates how new lines inside the block should behave.
If you want to keep them as new lines, use the literal style, indicated by a pipe
|. If instead, you want them to be replaced by spaces, use the folded style, indicated by a right angle bracket
Block Chomping Indicator: The chomping indicator controls what should happen with new lines at the end of the string. The default, clip, puts a single new line at the end of the string. To remove all new lines, strip them by putting a minus sign
- after the style indicator. Both clip and strip ignore how many new lines are actually at the end of the block; to keep them all put a plus sign
+ after the style indicator.