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

[File inclusion] add support for representing a text file as an array of lines #20

Closed
nemesisdesign opened this Issue Oct 21, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@nemesisdesign
Member

nemesisdesign commented Oct 21, 2015

The only way to add strings containing new lines in JSON is to use the escaped form \n.

Therefore to add a file with multiple lines in netjsonconfig now one has to do:

{
    "files": [
        {
            "path": "/root/.ssh/authorized_keys",
            "contents": "sshkey1\nsshkey2\nsshkey3"
        }
    ]
}

It would be nice to add support to an array representation, each element of the array representing a line of a file:

{
    "files": [
        {
            "path": "/root/.ssh/authorized_keys",
            "contents": [
                "sshkey1",
                "sshkey2",
                "sshkey3"
            ]
        }
    ]
}

This would also improve readability a great deal.

@nemesisdesign nemesisdesign added this to the 0.2 milestone Oct 21, 2015

@nemesisdesign nemesisdesign self-assigned this Oct 21, 2015

nemesisdesign added a commit that referenced this issue Oct 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment