Skip to content

Passing an empty file with @ syntax now throws an error on 1.7 #194

@jsifuentes

Description

@jsifuentes

Prior to 1.7, jo would place an empty string as the field value rather than throwing an error.

touch empty_file
jo "value=@empty_file"

On 1.7:

jo: Error reading file empty_file

Prior to 1.7:

{"value":""}

Based on the changelog, I think this refactor was the cause of the new behavior: #192

--

I found this behavior because it broke a script that did something like the following:

local stdout="$(mktemp)"
local stderr="$(mktemp)"

brew install somepackage 1>"$stdout" 2>"$stderr"

jo stdout="@$stdout" stderr="@$stderr"

When there is nothing in stderr, the resulting file is empty, which now causes jo to throw an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions