Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core feature request] run multiline string command #753

Open
benkeil opened this issue Apr 13, 2023 · 1 comment
Open

[Core feature request] run multiline string command #753

benkeil opened this issue Apr 13, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@benkeil
Copy link
Contributor

benkeil commented Apr 13, 2023

What feature do you need?

If the run command, contains \n it should be also a multiline string in the resulting yaml for better readability.

Do you have an example usage?

run(
    name = "upload package to s3",
    workingDirectory = workingDir,
    command = """
        VERSION=$(cat package.json | jq -r '.version')
        BUCKET_NAME=$(aws ssm get-parameter --name $bucketNameSsmParameter | jq -r '.Parameter.Value')
        aws s3 cp dist s3://$bucketName/apps/accountinfo/$version/ --recursive 
        echo $version > VERSION
        aws s3 cp VERSION s3://$bucketName/apps/accountinfo/
    """.trimIndent(),
)

Is there a workaround for not having this feature? If yes, please describe it.

no impact, just not as readable as multiline

@benkeil benkeil added the enhancement New feature or request label Apr 13, 2023
@krzema12
Copy link
Member

krzema12 commented Apr 13, 2023

Yes, I agree that ideally the new lines should be present in the YAML.

Here's a related issue: #616 where we set max line length for snakeyaml (our YAML emitting library) to max, but it was rather a mitigation/workaround than a proper solution:

// Otherwise line breaks appear in places that create an incorrect YAML, e.g. in the middle of GitHub
// expressions.
.setWidth(Int.MAX_VALUE)

It was likely caused by a bug in snakeyaml. We track reporting this and other issues to the maintainer in #634. Once this is fixed, we can consider going back to having proper new lines in the emitted YAML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants