mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-26 02:13:03 +01:00
fix(jsontools): print JSON, not YAML, in pp_json with the ruby method (#14263)
* fix(jsontools): print JSON, not YAML, in `pp_json` with the ruby method The ruby implementation of `pp_json` converted the parsed input to YAML (`to_yaml`), while the node and python3 implementations, and the README, pretty-print JSON. Use `JSON.pretty_generate` with the same 4-space indent as the other methods. * test(jsontools): cover the ruby method
This commit is contained in:
1 parent
a7f4e49946
commit
ca0a63f0ee
2 files changed
+55
-2
No files matched your search
@@ -86,8 +86,7 @@ print(unquote_plus(sys.stdin.read()))
|
||||
function pp_json() {
|
||||
ruby -e '
|
||||
require "json"
|
||||
require "yaml"
|
||||
puts JSON.parse(STDIN.read).to_yaml
|
||||
puts JSON.pretty_generate(JSON.parse(STDIN.read), indent: " ")
|
||||
'
|
||||
}
|
||||
function is_json() {
|
||||
|
||||
Reference in new issue
Block a user