mwaylabs / Espresso

The-M-Projects build tools using node.js.
www.the-m-project.org
Other
84 stars 28 forks source link

package json-print: fail if property cannot be found #90

Closed 4z3 closed 12 years ago

4z3 commented 12 years ago

This commit fixes an issue, where json-print would print undefined thinking it's valid JSON.

Example

$ cat file.json
{
   "foo": {}
}

# old behavior
$ json-print file.json foo bar; echo $?
undefined
0

# new behavior
$ json-print file.json foo bar; echo $?
foo.json: foo.bar is undefined
23