ddopson / underscore-cli

Command-line utility-belt for hacking JSON and Javascript.
Other
1.72k stars 83 forks source link

text output format not working #46

Open john-cosnowski opened 8 years ago

john-cosnowski commented 8 years ago

--outfmt text appears to be broken because underscore.string version 3.2.3 added map function.

output is: Error formatting output data in mode 'text': undefined is not a function

makevoid commented 8 years ago

If somebody needs to hotfix, you can do it by simply removing a join here: https://github.com/makevoid/underscore-cli/commit/e0115038177fcb8d90a2713a38678fdc1c19eba5

I suppose the "base" error is in underscore.strings, from their docs they say the map function shouldn't be required when underscore.strings is mixed in underscore and the two function collide.

This code from u.strings ( https://github.com/epeli/underscore.string/blob/c1f7b1fa64bd6cecbe05689c05e66f7df68d8797/exports.js#L5 ) is checking for map and should not include it but it seems to get mixed in anyway for some reason.

kshamil76 commented 8 years ago

The package.json for underscore-cli is using "*" for underscore.string, which allows for broken compatibility (although in this case it probably would've broken anyway). We worked around this issue by adding a specific version of underscore.string to our package.json (not the underscore-cli package.json), which forces underscore-cli to use the working version.

Here is the version we are using: "underscore.string": "3.1.1"

makevoid commented 8 years ago

Maybe it can be locked on master until the issue is fixed?

scien commented 8 years ago

+1. just ran into this