zlin / wgetpaste

MIT License
34 stars 18 forks source link

Enhancement: use jq utility for JSON stuff #20

Open bcattaneo opened 4 years ago

bcattaneo commented 4 years ago

I recommend doing the following:

    jq -Mnc ".expiry = \"${expiration}\" | .files[0] = { name: \"${description}\", lexer: \"${language}\", content: \"${content}\" }"

It will add a dependency on the jq utility; however, jq can also be used in geturl to parse JSON output instead of relying on regular expressions.

Using jq also enables the removal of some of the escape functions used below.

_Originally posted by @nvinson in https://github.com/zlin/wgetpaste/pull/16#discussion_r487847858_

mjeveritt commented 3 years ago

@nvinson @Cogitri any chance of merging this?

Cogitri commented 3 years ago

This is an issue so nothing to merge here. Please don't go around and ping folks in issues like this, especially if there's nothing to act on.

mjeveritt commented 3 years ago

It looks like this has dovetailed into #24 which wrapped up a few outstanding issues, which spread across a couple of PR's and Issues. Apologies for the extra pings @Cogitri - I had seen some updates occur on the main/master branch, but it didn't look like any of this cluster of issues had been addressed, and I felt that some clean-up was overdue. Hopefully with #24 we can tidy this lot up, and fix a string of bugs all in one shot. Thanks again to @nvinson for hopefully wrapping this up, and @bcattaneo for some of the preliminary work & intermediate steps.

heirecka commented 1 year ago

I'm not sure it's good for a bash script to depend on jq, at least not as hard dependency. Considering that it's not only jq you'll need, but it seems jq depends on oniguruma, which combined seems to be a bit heavy.