wgetpaste icon indicating copy to clipboard operation
wgetpaste copied to clipboard

Enhancement: use jq utility for JSON stuff

Open bcattaneo opened this issue 4 years ago • 4 comments

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

bcattaneo avatar Oct 20 '20 17:10 bcattaneo

@nvinson @Cogitri any chance of merging this?

mjeveritt avatar Feb 23 '21 02:02 mjeveritt

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.

Cogitri avatar Feb 23 '21 12:02 Cogitri

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.

mjeveritt avatar Feb 26 '21 09:02 mjeveritt

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.

heirecka avatar Nov 21 '22 21:11 heirecka