Skip to content

Breaks on environment variables with newlines #15

@tesujimath

Description

@tesujimath

As described in nix-community/home-manager#4313 (comment)

Problem is easy to reproduce:

aya$ echo "export tEsT='mult
iline'"| bash-env-json
jq: parse error: Expected separator between values at line 2, column 7

and it is because of this:

aya$ echo -n 'mult
iline'| jq -R
"mult"
"iline"

which is easy to fix:

aya$ echo -n 'mult
iline'| jq -Rs
"mult\niline"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions